Repository navigation
fix(ci): restore shared Codex fork monitor helper #16797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7f82e94
fix(ci): restore shared Codex fork monitor helper
austinywang 6be3a98
docs: clarify shared Codex monitor contract
austinywang 4c37fcf
fix: share Codex fork monitor contract in package
austinywang bc554f1
fix: satisfy package namespace conventions
austinywang 2fcf98a
fix: retain app-side Codex monitor compatibility
austinywang 9863752
fix: import shared Codex monitor contract
austinywang 40c6dc9
fix: call Codex monitor builder instance
austinywang c8af4f7
fix: remove unused cloud port bindings
austinywang 0e9caca
Update Cloud port row tests for the removed open action
lawrencecchen e86f05f
Remove bare port help fallback
austinywang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
Packages/macOS/CMUXAgentLaunch/Sources/CMUXAgentLaunch/CodexForkMonitorArguments.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /// Builds the arguments forwarded to a detached Codex fork monitor. | ||
| public struct CodexForkMonitorArguments: Sendable { | ||
| /// Creates a stateless argument builder. | ||
| public init() {} | ||
|
|
||
| /// Preserves the parent-session claim and optional launch ownership values. | ||
| public func make(environment: [String: String]) -> [String] { | ||
| guard let forkParent = environment["CMUX_AGENT_FORK_PARENT_SESSION_ID"], | ||
| !forkParent.isEmpty else { return [] } | ||
| var arguments = ["--fork-parent", forkParent] | ||
| if let launchID = environment["CMUX_AGENT_FORK_LAUNCH_ID"], !launchID.isEmpty { | ||
| arguments += ["--fork-launch-id", launchID] | ||
| } | ||
| if let ownerPID = environment["CMUX_CODEX_PID"], !ownerPID.isEmpty { | ||
| arguments += ["--fork-owner-pid", ownerPID] | ||
| } | ||
| return arguments | ||
| } | ||
| } |
28 changes: 28 additions & 0 deletions
28
...ges/macOS/CMUXAgentLaunch/Tests/CMUXAgentLaunchTests/CodexForkMonitorArgumentsTests.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import CMUXAgentLaunch | ||
| import Testing | ||
|
|
||
| @Suite("CodexForkMonitorArguments") | ||
| struct CodexForkMonitorArgumentsTests { | ||
| private let builder = CodexForkMonitorArguments() | ||
|
|
||
| @Test("forwards fork ownership values") | ||
| func forwardsOwnershipValues() { | ||
| #expect(builder.make(environment: [ | ||
| "CMUX_AGENT_FORK_PARENT_SESSION_ID": "parent-session", | ||
| "CMUX_AGENT_FORK_LAUNCH_ID": "launch-id", | ||
| "CMUX_CODEX_PID": "1234", | ||
| ]) == [ | ||
| "--fork-parent", "parent-session", | ||
| "--fork-launch-id", "launch-id", | ||
| "--fork-owner-pid", "1234", | ||
| ]) | ||
| } | ||
|
|
||
| @Test("omits optional values when absent") | ||
| func omitsOptionalValuesWhenAbsent() { | ||
| #expect(builder.make(environment: [ | ||
| "CMUX_AGENT_FORK_PARENT_SESSION_ID": "parent-session", | ||
| ]) == ["--fork-parent", "parent-session"]) | ||
| #expect(builder.make(environment: [:]).isEmpty) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.