Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Orbit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.orbit.codex";
PRODUCT_NAME = Orbit;
REGISTER_APP_GROUPS = YES;
Expand Down Expand Up @@ -454,7 +454,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.orbit.codex";
PRODUCT_NAME = Orbit;
REGISTER_APP_GROUPS = YES;
Expand All @@ -476,7 +476,7 @@
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.2;
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.orbit.codex.tests";
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = NO;
Expand All @@ -497,7 +497,7 @@
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
MACOSX_DEPLOYMENT_TARGET = 14.2;
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.orbit.codex.tests";
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = NO;
Expand All @@ -516,7 +516,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.orbit.codex.uitests";
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = NO;
Expand All @@ -535,7 +535,7 @@
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 6D7X9GGZAW;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0.2;
MARKETING_VERSION = 1.0.3;
PRODUCT_BUNDLE_IDENTIFIER = "com.orbit.codex.uitests";
PRODUCT_NAME = "$(TARGET_NAME)";
STRING_CATALOG_GENERATE_SYMBOLS = NO;
Expand Down
29 changes: 18 additions & 11 deletions Orbit/OrbitCodexEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ enum OrbitCodexEnvironment {
return baseURL.appendingPathComponent("Orbit", isDirectory: true)
}

private static func makeConfigContents(
static func makeConfigContents(
logDirectory: URL,
sqliteDirectory: URL,
configuredSkillPaths: [String: URL]
configuredSkillPaths: [String: URL],
modelInstructionsPath: String? = nil
) -> String {
var lines: [String] = [
"model = \"gpt-5.4-mini\"",
Expand All @@ -123,24 +124,30 @@ enum OrbitCodexEnvironment {
"mcp_oauth_credentials_store = \"file\"",
"log_dir = \(tomlString(logDirectory.path))",
"sqlite_home = \(tomlString(sqliteDirectory.path))",
"history.persistence = \"save-all\"",
"",
"[features]",
"apps = true",
"fast_mode = true",
"multi_agent = false",
""
"history.persistence = \"save-all\""
]

if let instructionsPath = bundledModelInstructionsPath()?.path {
// `model_instructions_file` is a top-level key. If it appears after
// `[features]`, TOML nests it under that table and Codex rejects the
// config because `features.*` entries must be booleans.
if let instructionsPath = modelInstructionsPath ?? bundledModelInstructionsPath()?.path {
lines += [
"",
"model_instructions_file = \(tomlString(instructionsPath))",
""
]
} else {
OrbitSupportLog.append("codex", "bundled Orbit model instructions were not found in the app bundle.")
}

lines += [
"",
"[features]",
"apps = true",
"fast_mode = true",
"multi_agent = false",
""
]

if let chromeDevToolsCommand = bundledBrowserCommand(named: "chrome-devtools-mcp") {
lines += [
"[mcp_servers.chrome-devtools]",
Expand Down
15 changes: 15 additions & 0 deletions OrbitTests/OrbitTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Foundation
import Testing
@testable import Orbit

Expand Down Expand Up @@ -30,4 +31,18 @@ struct OrbitTests {

#expect(shouldTreatPermissionAsGranted)
}

@Test func modelInstructionsStayTopLevelInGeneratedCodexConfig() async throws {
let config = OrbitCodexEnvironment.makeConfigContents(
logDirectory: URL(fileURLWithPath: "/tmp/orbit-log"),
sqliteDirectory: URL(fileURLWithPath: "/tmp/orbit-sqlite"),
configuredSkillPaths: [:],
modelInstructionsPath: "/tmp/OrbitModelInstructions.md"
)

let instructionsRange = try #require(config.range(of: "model_instructions_file"))
let featuresRange = try #require(config.range(of: "\n[features]\n"))

#expect(instructionsRange.lowerBound < featuresRange.lowerBound)
}
}
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fi
DEFAULT_MARKETING_VERSION="$(
sed -nE 's/^[[:space:]]*MARKETING_VERSION = ([^;]+);$/\1/p' "${PROJECT_DIR}/Orbit.xcodeproj/project.pbxproj" | head -n 1
)"
MARKETING_VERSION="${1:-${DEFAULT_MARKETING_VERSION:-1.0.2}}"
MARKETING_VERSION="${1:-${DEFAULT_MARKETING_VERSION:-1.0.3}}"
BUILD_NUMBER="${2:-$(date +%Y%m%d%H%M)}"
TAG="v${MARKETING_VERSION}"
DMG_PATH="${BUILD_DIR}/${APP_NAME}-${MARKETING_VERSION}.dmg"
Expand Down
Loading