Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughReplay safety now accepts a self-contained goal follow-up after a fully settled tool batch. The specification documents the replay proof, and unit and integration tests cover valid, invalid, account-neutral, and file-pinned recovery paths. ChangesTool-manifest replay follow-up
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The recovery flow accepts only fully settled tool batches with a trailing fresh follow-up, while covered account-owned file cases remain blocked. No actionable merge risk remains. Sequence Diagram(s)sequenceDiagram
participant Client
participant ResponsesBridge
participant ReplaySafety
participant OwnerDatabase
participant ReplacementUpstream
Client->>ResponsesBridge: resend settled tool batch with goal follow-up
ResponsesBridge->>ReplaySafety: validate replay suffix
ReplaySafety-->>ResponsesBridge: accept exact manifest and trailing input
ResponsesBridge->>OwnerDatabase: check original owner availability
ResponsesBridge->>ReplacementUpstream: send unanchored full-history replay
ReplacementUpstream-->>ResponsesBridge: return replacement response
ResponsesBridge-->>Client: return completed goal follow-up
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (5 skipped: 4 unsupported, 1 too large.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
The new trailing-followup allowance skips the stricter account-neutral/known-fields validation for those follow-up items, which can weaken replay safety guarantees (comment ID: 001).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends the durable full-resend safety proof used by the proxy HTTP bridge so that, after a fully settled pending-tool-call manifest, a trailing self-contained user “goal follow-up” message can be accepted—enabling safe re-anchoring away from an unavailable prior owner while preserving the full projected input.
Changes:
- Allow
responses_input_suffix_matches_pending_tool_calls(...)to tolerate a trailing self-contained user follow-up after an exact, complete tool-call/result batch. - Add unit + integration coverage for the goal-followup resend case across both
/backend-api/codex/responsesand/v1/responses, including rejection when account-owned files are involved. - Update the Responses API compatibility OpenSpec with a normative requirement and archive the corresponding verified change artifacts.
File summaries
| File | Description |
|---|---|
| app/modules/proxy/replay_safety.py | Updates suffix-proof logic to permit trailing fresh user follow-up after exact tool-manifest settlement. |
| tests/unit/test_replay_safety.py | Adds regression tests for allowing goal follow-up and for rejecting malformed/relaxed tool-manifest fences. |
| tests/integration/test_http_responses_bridge.py | Adds end-to-end bridge tests validating recovery from unavailable owners and rejection for file-pinned replays. |
| openspec/specs/responses-api-compat/spec.md | Adds the “Exact tool-manifest replay preserves fresh user follow-up” requirement and scenarios. |
| openspec/changes/archive/2026-09-06-recover-tool-complete-goal-followup/tasks.md | Archives the change task checklist (verification + publication). |
| openspec/changes/archive/2026-09-06-recover-tool-complete-goal-followup/specs/responses-api-compat/spec.md | Archives the delta-spec excerpt for the added requirement. |
| openspec/changes/archive/2026-09-06-recover-tool-complete-goal-followup/proposal.md | Archives the change proposal and scope/constraints. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # A goal restart or steer can append user input after a fully settled | ||
| # prior-response tool batch. Prove that batch independently: new input | ||
| # must not stand in for a missing parallel call or interrupt its results. | ||
| first_followup = next( | ||
| (index for index, item in enumerate(suffix) if isinstance(item, dict) and _is_fresh_followup_input(item)), | ||
| len(suffix), | ||
| ) | ||
| if not all(isinstance(item, dict) and _is_fresh_followup_input(item) for item in suffix[first_followup:]): | ||
| return False | ||
| suffix = suffix[:first_followup] |
|
Verified on main Two things stand between this and merge:
On the Copilot thread at Heads-up: #2086 rewrites the body of the same function (prefix-settled outputs); whichever lands second will need a small textual rebase. |
…context (#30) * fix(proxy): recover tool-complete continuations from unavailable owners Preserve canonical replay ownership checks and make unreplayable continuity errors actionable. Regression scenarios adapted from Soju06#2121 and extended for temporary rate limits, explicit anchors, unknown fields and repeated rejection. * docs(proxy): verify and archive continuity-owner recovery * docs(proxy): record recovery verification on beta6
|
This pull request has been automatically marked as stale because it has had no activity for 7 days. It will be closed in 23 more days unless there is new activity. If this is still relevant, please:
Thanks for the contribution 🙏 |
Summary
Allow a complete, durable-manifest-verified tool batch to be followed by fresh user input when proving that a full resend can recover from an unavailable response owner.
Refs #1707 — partial fix for replayable tool-complete goal restarts. This does not make opaque encrypted compaction checkpoints portable between accounts.
Type of change
fix:— bug fixOpenSpec
Archived change:
openspec/changes/archive/2026-09-06-recover-tool-complete-goal-followup/Changes
No settings, migrations, defaults, or dashboard changes.
Test plan
Base: current upstream
main,5ad638b6a4c9c094bcc8866b1d7487173fe3b54e.With the production helper patch removed, the new goal-recovery regression failed on both HTTP endpoints with 502. With the patch, it recovers without the unavailable owner's anchor and retains the complete input.
An earlier broad run with a 60-second per-test timeout timed out in the existing idle-reader replacement test; the 120-second run above passed. These are local test results, not a claim about hosted CI or production deployment.
Example behavior
The replay input contains a verified stored prefix, the prior response's complete tool call and result, and a new goal instruction. There is no client-supplied
previous_response_id.previous_response_owner_unavailablewhen its owner cannot serve.Checklist
Summary by CodeRabbit
New Features
Bug Fixes