fix: unblock codex harness turns and hot-swap models mid-session#1
Merged
OmGuptaIND merged 2 commits intomainfrom Apr 20, 2026
Merged
fix: unblock codex harness turns and hot-swap models mid-session#1OmGuptaIND merged 2 commits intomainfrom
OmGuptaIND merged 2 commits intomainfrom
Conversation
`turn/start` was being rejected with `missing field 'type'` because
`readOnlyAccess: {}` doesn't match the `ReadOnlyAccess` union (requires
`type: 'fullAccess' | 'restricted'`). Set it to `fullAccess` so workspace
writes keep unrestricted reads outside the workspace.
Harness sessions previously skipped the default-model switch entirely,
so picking a new model mid-conversation silently kept routing to the
original one. Added `switchModel` to both `HarnessSession` and
`CodexHarnessSession` — same-provider switches mutate `this.model` and
take effect on the next turn (codex via `turn/start.model` override,
claude via `--model` arg at spawn). Cross-provider switches stay on the
old session and log an explicit reason.
Also surfaced per-session outcomes in logs with `apiSwitched`,
`harnessSwitched`, and `harnessSkipped` counts so the effect of a
provider change is visible.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Session IDs are plain `sess_xxx` and carry no project info, so the
legacy regex in `deleteSession` never matched and
`~/.anton/projects/{projectId}/conversations/{id}/` was left on disk.
`handleProjectSessionsList` reads that folder directly, so destroyed
sessions reappeared on reload.
`deleteSession` now takes an optional projectId (already passed from
`handleSessionDestroy`) and falls back to scanning the projects root
when no hint is available, so the on-disk folder is removed regardless
of session ID shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OmGuptaIND
added a commit
that referenced
this pull request
Apr 20, 2026
### Fixes - unblock codex harness turns and hot-swap models mid-session (#1)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
turn/start: Invalid request: missing field 'type'(code -32600) that was aborting every codex-harness turn at 0 chars —readOnlyAccess: {}was missing thetypediscriminator required by theReadOnlyAccessunion; now{ type: 'fullAccess' }.switchModel(provider, model)to bothHarnessSession(claude) andCodexHarnessSessionso picking a different model mid-conversation actually takes effect on the next turn. Same-provider only — cross-provider switches keep the old session and log a clear reason.handleProviderSetDefaultwithapiSwitched/harnessSwitched/harnessSkippedcounts so model-picker changes are visible in server logs.Test plan
-32600bug).Switched harness session model (applies to next turn).cross-provider switch requires a new session; a new session picks up the new provider/model.🤖 Generated with Claude Code