Skip to content

fix(harness-codex): improve Codex prompt framing and avoid placing relay shim file in session workdir - #16485

Merged
felixarntz merged 14 commits into
mainfrom
fa/harness-codex-fixes
Jun 30, 2026
Merged

fix(harness-codex): improve Codex prompt framing and avoid placing relay shim file in session workdir#16485
felixarntz merged 14 commits into
mainfrom
fa/harness-codex-fixes

Conversation

@felixarntz

@felixarntz felixarntz commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Background

The Codex harness was formatting its custom instructions for the CLI relay shim inconsistently, using Markdown heading instead of <tag> boundaries. It was also passing those instructions on every single turn rather than only on the very first turn, which was wasteful.

And despite #16441, it was sometimes still stopping after a single turn. Chatting to the model, it explained that it should not have sent the message in the final channel when it hadn't yet addressed the request. This underlying terminology probably makes sense to patch into the custom instructions for Codex.

Additionally, it placed the CLI relay shim file in the session workdir, which was problematic if the session workdir was being used for actual work where that file could pollute the workspace (e.g. a git repo checkout).

Summary

  • Fix Codex instructions formatting for the prompt
  • Only pass the custom instructions for the first turn of a session
  • Place the relay shim file in the .agent-runs session-specific infrastructure directory rather than the session workdir.

Manual Verification

Run the http://localhost:3000/harness/codex/* interactive examples.

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

@felixarntz felixarntz changed the title Fa/harness codex fixes fix(harness-codex): improve Codex prompt framing and avoid placing relay shim file in session workdir Jun 29, 2026
@felixarntz
felixarntz marked this pull request as ready for review June 29, 2026 20:00
@felixarntz
felixarntz merged commit 0d1cb8e into main Jun 30, 2026
49 checks passed
@felixarntz
felixarntz deleted the fa/harness-codex-fixes branch June 30, 2026 13:42
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
@ai-sdk/amazon-bedrock 5.0.5 github npm
@ai-sdk/harness-codex 1.0.11 github npm

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

Labels

harness/codex Issues related to @ai-sdk/harness-codex task-merge-tracking-no-issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants