fix(runner): advertise codex in the /health harnesses list - #5964
fix(runner): advertise codex in the /health harnesses list#5964WhoamiI00 wants to merge 1 commit into
Conversation
`HARNESS_KINDS` was a hardcoded three-entry list that was never extended when Codex became a harness of its own, so `GET /health` reported [pi_core, claude, pi_agenta] on a runner that drives Codex fine. Nothing is gated on the list (its only consumer is the health payload; `run-plan.ts` maps `codex` to its ACP agent separately), so no run was ever blocked -- but a client reading the payload concludes Codex is unsupported, and it misleads anyone debugging a Codex mount into thinking the image lacks Codex. The SDK enum already carries the four harnesses (`HarnessKind` in sdks/python/agenta/sdk/agents/dtos.py, pinned by test_harness_identity.py), as does the generated API client; only the runner was stale. Add `codex` and note the enum as the source of truth. The drift survived because both /health tests only asserted `Array.isArray(harnesses)` and never its contents. Both now pin the member set, so the next harness cannot be added without updating the advertisement. Also refresh the `AgentRunRequest.harness` docstring, which listed the same stale three ids. Closes Agenta-AI#5693
|
@WhoamiI00 is attempting to deploy a commit to the agenta projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @WhoamiI00, thanks for opening a pull request. 🙏 This PR was automatically closed because it does not yet meet our contribution requirements:
We ask for this so every change is documented and demonstrably tested before review. How to get it reopened See the Contributing guide and Creating your first PR. If you think this was closed in error, leave a comment and a maintainer will take a look. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe runner now documents Codex as a supported harness and includes it in ChangesCodex harness advertisement
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing in favour of #5715, which predates this by a week and fixes the same thing. Apologies for the duplicate — I checked the issue for assignees but not for open PRs referencing it, which is on me. Leaving this closed. @WahidSaeed's PR should be the one that lands. |
Summary
GET /healthdid not listcodexamong the runner's harnesses, so a client asking the runner what it supports concluded Codex was unavailable on a deployment where Codex runs work.Root cause:
HARNESS_KINDSinservices/runner/src/version.tsis a hardcoded list that was never extended when Codex became a harness of its own.Codex is a first-class harness everywhere else in the stack:
HarnessKindinsdks/python/agenta/sdk/agents/dtos.pycarries all four values, andtest_harness_identity.pypins the set as{"pi_core", "pi_agenta", "claude", "codex"}.web/packages/agenta-api-client/.../HarnessKind.ts) listsCodex: "codex"./runwire contract has arun_request.codex.jsongolden asserted from both the Python and TypeScript sides.run-plan.tsmapscodexstraight through to its ACP agent, andacp-interactions.tsbranches onacpAgent === "codex".Only the runner's advertisement was stale. Nothing is gated on
HARNESS_KINDS— the health payload is its sole consumer — so no run was ever blocked. The impact is that anything deciding what is available from this payload under-reports Codex, and it actively misleads while setting up a Codex mount: the endpoint saying Codex is absent reads as "the image doesn't have Codex" and sends you looking in the wrong place.Why it went unnoticed
Both
/healthtests asserted only thatharnesseswas an array, never its contents, so the list could drift from the enum silently. Both now pin the member set, which is what makes this a fix rather than a one-character patch.Changes
services/runner/src/version.ts— addcodex; document the SDK enum as the source of truth so the two are extended together.services/runner/src/protocol.ts— refresh theAgentRunRequest.harnessdocstring, which listed the same stale three ids./healthtests — assert the exact member set instead ofArray.isArray.Closes #5693
Testing
Verified locally
npx tsc --noEmitinservices/runner— passes (the typecheck gate CI runs).npx vitest run --project unit tests/unit/server.test.ts— 34/34 pass.npx vitest run --project acceptance tests/acceptance/server-contract.test.ts— 18/18 pass.src/version.tsback to the three-entry list fails the health test with the expected diff, and restoring it passes.--project unit): 2059 passed / 53 failed, identical before and after this change (same 15 files, byte-identical sets). Those 53 are pre-existing failures on my Windows machine caused by path-separator assumptions ('\tmp\run-agent\README.md'vs the expected'/tmp/run-agent/README.md') in suites likeworkspace-importandattachment-path-safety. They are unrelated to this change and do not occur on theubuntu-latestrunner CI uses.Added or updated tests
Updated the two existing
/healthtests rather than adding new ones, since the gap was in what they asserted:tests/unit/server.test.ts—GET /health returns runner identitynow asserts the sortedharnessesset equals["claude", "codex", "pi_agenta", "pi_core"].tests/acceptance/server-contract.test.ts— the/healthcontract test asserts the same set.The expected list is pinned as a literal rather than derived from
HARNESS_KINDS: asserting the payload against its own source would hold for any list, which is exactly how this drift survived. Sorted because the advertisement's order carries no meaning.QA follow-up
N/A — no runtime behaviour changes.
HARNESS_KINDShas no consumer other than the health payload, and Codex run dispatch goes through a separate path inrun-plan.tsthat this does not touch.Demo
N/A — not a UI change.
Checklist