feat(codex): deliver cross-provider catch-up via turn/start.additionalContext - #83
Conversation
…lContext
Replaces thread/inject_items (standalone user-role message) as the codex
catch-up channel. Injecting a bare user message leaves a dangling entry
in the native rollout with no matching turn, pollutes codex-native
history, and the eager-injection watermark advanced before the content
was tied to any turn.
- PromptInput.syncBlocks: catch-up context that must ride the same
submit; admission failure means not-delivered (watermark untouched,
re-injected next turn) — same semantics as the prepend path
- AdapterCapabilities.sync marker: adapter natively carries syncBlocks
as a side-channel; without it the runtime falls back to prepending
into the prompt text
- runtime: sync-capable adapters get syncBlocks instead of a text
prepend; watermark advances only after admission for both shapes
- codex adapter: drops syncContext/inject_items, declares sync, maps
syncBlocks to turn/start.additionalContext {baton-sync: {value,
kind: untrusted}} — codex records it as a contextual fragment inside
the turn and it bypasses UserPromptSubmit hooks
- verified against live codex 0.144.1 app-server: model answered the
secret word embedded in additionalContext and the turn completed
normally
Claude adapter (eager syncContext path) is unchanged.
| ...session.meta.providerSessions[key], | ||
| provider: key, | ||
| providerSessionId: | ||
| session.meta.providerSessions[key]?.providerSessionId ?? this.nativeSessionId(slot), |
There was a problem hiding this comment.
🤖 devloop code-review · seed-2.1-pro
Inconsistent access pattern for existing session data between two setProviderSession calls: the syncContext path (line 476) spreads the captured meta variable, while the post-submit path (line 506) re-reads session.meta.providerSessions[key]. Since the two paths are mutually exclusive (syncContext vs. sync/prepend), they produce equivalent results, but the inconsistency could confuse future readers or become fragile if the code is restructured. Consider using meta consistently in both paths, or re-reading from session.meta.providerSessions[key] in both.
ccr:fp=578e330df5d0
|
🤖 devloop code-review · 1 finding(s)(1 条已内联到 diff 行) |
Replaces thread/inject_items (standalone user-role message) as the codex
catch-up channel. Injecting a bare user message leaves a dangling entry
in the native rollout with no matching turn, pollutes codex-native
history, and the eager-injection watermark advanced before the content
was tied to any turn.
submit; admission failure means not-delivered (watermark untouched,
re-injected next turn) — same semantics as the prepend path
as a side-channel; without it the runtime falls back to prepending
into the prompt text
prepend; watermark advances only after admission for both shapes
syncBlocks to turn/start.additionalContext {baton-sync: {value,
kind: untrusted}} — codex records it as a contextual fragment inside
the turn and it bypasses UserPromptSubmit hooks
secret word embedded in additionalContext and the turn completed
normally
Claude adapter (eager syncContext path) is unchanged.