Repository navigation
fix(devin): handle denied Codex boilerplate and optional history rewrites - #8590
Conversation
The blocklist sanitizer only touched instruction surfaces (tool descriptions, the #2 system prompt); data fields stayed byte-exact, so one quoted trigger phrase anywhere in a long thread history made every later request fail with upstream permission_denied. New OPENCODEX_DEVIN_SANITIZE_DATA_SURFACES=1 opt-in extends the same rewrites to message text (#3), tool-call arguments (#6.3), image captions (#10.3) and replayed thinking (#11). Identifiers (tool name, tool_call_id) and opaque signature blobs stay byte-exact. Off by default: rewriting literal history changes what the model sees, so refusing stays the default failure. The permission_denied hint now names the opt-in. Tests pin both modes: data literal by default, rewritten when enabled.
Two more live-isolated triggers in the Codex CLI developer boilerplate: the identity sentence "Codex refers to the open-source agentic coding interface" and the "Don not output ANSI escape codes directly — the CLI renderer applies them" bullet. Both are rewritten meaning-preservingly like the existing entries. Also adds the dump/bisect probe scripts used to isolate the triggers.
Keep reasoning signatures only when the serialized thinking is unchanged. Preserve signature-only replay and default-off sanitization, and add wire, authentication and continuity regressions with matching adapter docs.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer integration (merge manager, owner backlog decision B: contributor bug fixes are reviewed and merged when correct).
Merging before #8703, which touches the same Devin rewrite table and will be rebased on top of this. |
…8765) Translate the Devin data-surface sanitizer note that #8590 added to the English adapters reference, restoring Spanish docs parity (docs-spanish-localization test: 28/2 on dev before, 30/0 after). Co-authored-by: Epinephrine <[email protected]>
…e-jun#8558) Claude Code's system prompt carries three whole sentences that Cognition's content filter refuses with permission_denied, so every Claude Code turn to a Devin model failed while Codex worked on the same account. Each sentence was refused alone and on lowercase/whitespace/comma variants, so they are matched like the Codex entries and reworded without losing their authorization/safety meaning. The regression tests build requests through buildGetChatMessageRequest, assert the lidge-jun#2 system prompt is rewritten end to end, and assert every lidge-jun#3 message body (user text, history, thinking, tool-call arguments, tool results) is byte-identical to a control encoded without the system prompt. Existing table entries and their case sensitivity are unchanged. Rebased onto dev after lidge-jun#8590 merged: the three entries follow the two Codex boilerplate entries, the comment no longer depends on table position, lidge-jun#8590's Scope note is untouched, and the test file keeps its single `streamChatEvents, type ChatHistoryItem` import. Co-Authored-By: Claude Code <[email protected]>
Summary
Codex CLI boilerplate can cause Cognition to refuse otherwise valid Devin requests with
permission_denied. Add two narrowly matched instruction rewrites and an off-by-defaultOPENCODEX_DEVIN_SANITIZE_DATA_SURFACES=1option for histories that quote known trigger phrases.The option rewrites joined message text, tool-call arguments, image captions and replayed thinking in the outgoing payload. Tool names and call IDs remain unchanged. Rewritten thinking is sent without its stale signature/type; unchanged and signature-only replay retain their original fields. Stored history is unchanged. Exact quoted text may change when opted in, and unsigned replay does not guarantee upstream acceptance.
Local credential-reading diagnostic scripts are excluded from the final diff. Prepared and reviewed first in luvs01#817.
Verification
Current head:
33884d887cc1ebecb3049e8ec87330149df045bb, integrated with upstream devaa30ea9d5e.bun test tests/providers/devin-adapter.test.ts tests/providers/devin-chat-wire-fixes.test.ts tests/providers/devin-reasoning-continuation.test.ts tests/providers/devin-anthropic-signature-fallback.test.ts tests/providers/devin-hardening.test.ts tests/providers/devin-image-passthrough.test.ts: 218 pass, 0 fail, 1,647 assertions.bun check --no-script --noEmit: passed, 2,433 files.bun run structure:check,bun run privacy:scanandgit diff --check: passed.codex-account-pool-target-switch.test.tsx:262, 3 reads expected, 2 observed); that failure is recorded separately and has not been dismissed or rerun.b534b8849b: the formerly denied Devin chat completed with HTTP 200 and an OK response. This predates the signature-consistency follow-up and is not evidence for live acceptance of rewritten signed thinking.test:changedselection was blocked by automatic approval review for unrelated external Google egress; it was not retried through another route. Focused transport tests use mocked network responses. Broader coverage is left to hosted CI.Checklist
Summary by CodeRabbit
"1".