Skip to content

fix(codex): send Pylon's instructions when a thread starts - #642

Merged
rynfar merged 1 commit into
pylonfrom
fix/codex-thread-instructions
Sep 18, 2026
Merged

rynfar merged 1 commit into
pylonfrom
fix/codex-thread-instructions

Conversation

@rynfar

@rynfar rynfar commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

Codex threads now receive Pylon's runtime instructions as developerInstructions on thread/start and thread/resume. Until now they were sent only inside each turn's collaboration mode, and Codex 0.153.4 does not pass that copy to the model.

Why it matters

On Codex 0.153.4 a Codex thread in Pylon has been running without any of Pylon's guidance: pull request linking, the collaborative browser, devices, delegation, and the pair protocol. Found while testing pair mode, where a Codex lead behaved as if it had never been told about the executor.

Evidence

Same question to a fresh Codex thread (GPT-6-Astra), isolated server, "which application and harness are you running inside?":

  • Before: "I'm running in the Codex application within an OpenAI agent harness."
  • After: "I'm running inside Pylon through the Codex harness."

codex features list shows collaboration_modes as removed. The provider log confirms Pylon was sending the instructions in turn/start all along.

Asking a model to quote its instructions is not a usable probe: it answered "none" in both cases. The test has to be something only the instructions could tell it.

How

  • buildCodexThreadInstructions(toolsAvailable): Pylon's runtime instructions for the tools this session's credential grants, without Codex's own mode template.
  • openCodexThread takes developerInstructions and puts it on both the resume and the start request, so the fallback from a failed resume carries it too.
  • The per-turn copy is unchanged, for older Codex versions.

Verification

  • vp test run on RuntimeInstructions.test.ts, CodexSessionRuntime.test.ts, CodexAdapter.test.ts: 131 passed. The two new tests were written first and seen failing with the implementation reverted.
  • Typecheck t3: 0 errors. Format and lint clean on the changed files.
  • Live A/B above.

Known limits

  • Whether thread/resume applies new instructions to an existing conversation is not verified; a resumed thread was inconclusive.
  • An older Codex that honors the per-turn copy now sees Pylon's instructions twice.
  • Codex stays refused as a pair lead. Its collaboration.* tools cannot be turned off, so re-allowing it needs a clean paired run first.

Part of #622.

Model: Claude Fable 5.1, in Pylon via the Claude Code harness.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pylon-marketing Ready Ready Preview Sep 18, 2026 5:46pm UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 14.0 KiB 14.0 KiB −3 B (−0.0%) 15.1 KiB ✅
Codex Thread snapshot wire 7.2 KiB 7.2 KiB −10 B (−0.1%) 7.3 KiB ✅
Codex Live turn WebSocket wire 6.7 KiB 6.7 KiB +7 B (+0.1%) 7.8 KiB ✅
Codex Live turn WebSocket decoded 58.0 KiB 58.0 KiB 0 B (0.0%) 66.4 KiB ✅
Codex Live turn messages 9 9 0 (0.0%) 21 ✅
Claude Total thread wire 14.0 KiB 14.0 KiB −1 B (−0.0%) 15.1 KiB ✅
Claude Thread snapshot wire 7.2 KiB 7.2 KiB 0 B (0.0%) 7.3 KiB ✅
Claude Live turn WebSocket wire 6.7 KiB 6.7 KiB −1 B (−0.0%) 7.8 KiB ✅
Claude Live turn WebSocket decoded 58.9 KiB 58.9 KiB 0 B (0.0%) 66.4 KiB ✅
Claude Live turn messages 9 9 0 (0.0%) 21 ✅

Baseline: 6468f56 · PR result: 5f9d104 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 115.6 KiB
  • Claude decoded thread snapshot: 116.3 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar
rynfar merged commit d001fa4 into pylon Sep 18, 2026
19 checks passed
@rynfar
rynfar deleted the fix/codex-thread-instructions branch September 18, 2026 19:49

This branch was successfully deployed

1 active deployment
Preview — 5f9d1041 Deployed Sep 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant