Skip to content

fix(codex): steer active turns for /ps guidance - #1530

Closed
AaronZ345 wants to merge 6 commits into
chenhg5:mainfrom
AaronZ345:agent/fix-codex-ps-steer
Closed

fix(codex): steer active turns for /ps guidance#1530
AaronZ345 wants to merge 6 commits into
chenhg5:mainfrom
AaronZ345:agent/fix-codex-ps-steer

Conversation

@AaronZ345

Copy link
Copy Markdown
Contributor

Summary

  • steer an active Codex app-server turn with turn/steer instead of starting a second turn
  • preserve the active turn ID, buffered text, and prompt preamble while applying /ps guidance
  • keep the existing turn/start behavior for idle sessions and reject mismatched steering responses
  • make four pre-existing environment-sensitive tests hermetic so the full local suite is reliable

Why

/ps calls AgentSession.Send while the current turn is still running. The Codex app-server implementation previously treated every Send as turn/start, reset the active-turn state, and cleared buffered messages. That race could emit an empty result even though Codex later completed a full answer.

Codex exposes turn/steer for same-turn guidance. This change uses it with the active expectedTurnId, matching Codex's native guidance behavior without turning the guidance into a separate user turn.

Testing

  • go test ./...
  • go test -race ./agent/codex ./core ./platform/cloud-web
  • go vet ./...
  • go build ./...
  • generated the Codex 0.144.1 app-server JSON schema and verified the turn/steer request and response fields

@AaronZ345
AaronZ345 requested a review from chenhg5 as a code owner July 11, 2026 08:04
@AaronZ345
AaronZ345 force-pushed the agent/fix-codex-ps-steer branch 2 times, most recently from d194f28 to 8108fbc Compare July 14, 2026 03:02
@AaronZ345

Copy link
Copy Markdown
Contributor Author

Hi @chenhg5, I’ve rebased this PR onto the latest main and all five CI checks are green. Could you please take another look and merge it when you have a chance? Thanks!

@AaronZ345
AaronZ345 force-pushed the agent/fix-codex-ps-steer branch 2 times, most recently from 9c5df29 to 53bf7e5 Compare July 19, 2026 14:42
@AaronZ345
AaronZ345 force-pushed the agent/fix-codex-ps-steer branch 2 times, most recently from e08b746 to eb7186b Compare July 25, 2026 14:41
@AaronZ345
AaronZ345 force-pushed the agent/fix-codex-ps-steer branch from eb7186b to 4b878e7 Compare August 6, 2026 14:43
@AaronZ345

Copy link
Copy Markdown
Contributor Author

Superseded by #1665.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant