Repository navigation
fix(startup): skip unused native Codex ownership probes #7184
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
5 commits
Select commit
Hold shift + click to select a range
60ac74d
fix(startup): skip unused native Codex ownership probes when disabled
c85922a
test(startup): exercise fresh ownership snapshots with Codex enabled
a4c3fb0
Merge origin/dev into #7184
lidge-jun d0cdc26
test(codex): give bearer-admission server cases the server budget and…
lidge-jun e9fe073
Merge remote-tracking branch 'origin/dev' into fix/windows-start-latency
lidge-jun 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import { expect, test } from "bun:test"; | ||
| import { mkdtempSync } from "node:fs"; | ||
| import { tmpdir } from "node:os"; | ||
| import { join } from "node:path"; | ||
| import { saveConfig } from "../../src/config"; | ||
| import { startServer } from "../../src/server"; | ||
| import { installIsolatedCodexHome } from "../helpers/isolated-codex-home"; | ||
| import { removeTreeWithRetry } from "../helpers/remove-tree"; | ||
|
|
||
| test("Codex OFF starts without service-manager probes or native-main preparation", async () => { | ||
| const priorHome = process.env.OPENCODEX_HOME; | ||
| const home = mkdtempSync(join(tmpdir(), "ocx-start-codex-off-")); | ||
| const codex = installIsolatedCodexHome("ocx-start-codex-off-client-"); | ||
| process.env.OPENCODEX_HOME = home; | ||
| let inspections = 0; | ||
| let preparations = 0; | ||
| let server: ReturnType<typeof startServer> | undefined; | ||
| try { | ||
| saveConfig({ | ||
| providers: { fixture: { adapter: "openai-chat", baseUrl: "http://127.0.0.1:1/v1", allowPrivateNetwork: true } }, | ||
| defaultProvider: "fixture", port: 0, hostname: "127.0.0.1", | ||
| clientIntegrations: { codex: false }, checkForUpdates: false, | ||
| syncResumeHistory: false, claudeCode: { intercept: { enabled: false } }, | ||
| }); | ||
| server = startServer(0, { | ||
| inspectNativeCodexOwnership: () => { | ||
| inspections++; | ||
| return { ownership: "owned", reason: "unused Codex OFF probe" }; | ||
| }, | ||
| nativeMainStartup: { | ||
| get manager() { | ||
| preparations++; | ||
| throw new Error("Codex OFF must not prepare a native manager"); | ||
| }, | ||
| }, | ||
| }); | ||
| expect(inspections).toBe(0); | ||
| expect(preparations).toBe(0); | ||
| expect((await fetch(`http://127.0.0.1:${server.port}/healthz`)).status).toBe(200); | ||
| } finally { | ||
| await server?.stop(true); | ||
| codex.restore(); | ||
| if (priorHome === undefined) delete process.env.OPENCODEX_HOME; | ||
| else process.env.OPENCODEX_HOME = priorHome; | ||
| removeTreeWithRetry(home); | ||
| } | ||
| }); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Codex-OFF, sibling, or hub-without-local-integration starts, this branch now skips the first ownership probe and the analogous branch below skips the second, but
structure/ops/service-and-sidecars.md:109-113still states that every proxy startup asks twice and that the second query is mandatory. Update that mapped architecture document to scope the two-probe contract to enabled startup so it does not contradict the runtime.AGENTS.md reference: src/AGENTS.md:L11-L11
Useful? React with 👍 / 👎.