Repository navigation
fix(session): retry a transcript turn cloud refuses for a moment, instead of dropping it - #18
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Maintainer follow-up: New transcript retry fix: hold until cloud event-once is deployed and proven idempotent. Add regression for lost ACK/503, duplicate suppression, persistent outage and ordering/recovery; CI 45930604975 still running. |
|
Backend dependency now tracked in hanzo-inc/cloud#1043 (existing fix/event-once branch). Hold Gen retry until backend durable dedupe ships; do not enable auto-merge ahead of deployment. |
Review of #18 asked for ordering and recovery across a refusal. The stream forwards each turn in line, so a turn refused with a 503 is made again under its own requestId before the next turn is sent, and the transcript keeps the agent's order. Testing: turns_keep_their_order_across_a_retry passes; it fails with the previous commit reverted (the refused turn is dropped, so the requests read [a, b] instead of [a, a, b]). cargo test: 387 lib tests and the integration suites pass; cargo clippy --all-targets -- -D warnings clean. Risk: none; test only. How to revert: git revert this commit.
|
Your regression list, covered as follows:
This stays held until cloud#1043 is merged and deployed. It's left as a PR and not merged. |
…ain, not dropped A stream said "stream event dropped: 503: Request could not be securely recorded" and the turn was lost from the session's transcript: cloud's audit trail could not record the request, so nothing was applied, and the append was tried once. The wire's one retry policy (hanzo-client) repeats a POST after a 5xx only when the request names itself with a requestId, which the platform answers once. The event append now names itself, so a refused turn is made again under the same id. The stream forwards each turn in line with reading the agent, so those tries hold the agent's output while they wait. A cloud that stays down is waited on once: after a turn is lost the next go unnamed (one try, as before) until one lands. Needs cloud to store a repeated requestId once on POST /v1/agents/sessions/:id/events (hanzo-inc/cloud, branch fix/event-once) BEFORE this ships: today's cloud accepts the field and ignores it, so a repeat after a 5xx that did apply would store the turn twice. Testing: cargo test (386 lib tests and the integration suites pass); cargo clippy --all-targets -- -D warnings clean. New tests failed before the change: a_refused_event_is_made_again_under_the_same_request_id, each_event_names_itself_apart, a_cloud_that_stays_down_is_waited_on_once. Risk: a turn refused with a 5xx now waits up to the wire's backoff (about 1 s, 2 s, 4 s) before the next turn is read; bounded to one turn per outage. How to revert: git revert this commit.
Review of #18 asked for ordering and recovery across a refusal. The stream forwards each turn in line, so a turn refused with a 503 is made again under its own requestId before the next turn is sent, and the transcript keeps the agent's order. Testing: turns_keep_their_order_across_a_retry passes; it fails with the previous commit reverted (the refused turn is dropped, so the requests read [a, b] instead of [a, a, b]). cargo test: 387 lib tests and the integration suites pass; cargo clippy --all-targets -- -D warnings clean. Risk: none; test only. How to revert: git revert this commit.
|
Rebased onto
|
4288960 to
9dd0725
Compare
What happened
A Hanzo Dev run printed
warning: stream event dropped: 503: Request could not be securely recordedand the turn was lost from the session's transcript.Cloud's audit trail refuses a write it cannot record first (503
audit_unavailable, nothing applied). The event append was tried once, so the turn was dropped.The fix
hanzo-clientalready has one retry policy: a POST is repeated after a 5xx only when it names itself with arequestId, which the platform answers once. The event append now names itself, so a refused turn is made again under the same id.The stream forwards each turn in line with reading the agent, so those tries hold the agent's output while they wait. A cloud that stays down is therefore waited on once: after a turn is lost the next ones go unnamed (one try, as before) until one lands.
Ship order
Merge and deploy hanzo-inc/cloud
fix/event-oncefirst. Today's cloud acceptsrequestIdon this route and ignores it (verified: 201 with the field, no dedupe), so a repeat after a 5xx that did apply would store the turn twice. The cloud change stores a named turn once.Testing
cargo test: 386 library tests and the integration suites pass.cargo clippy --all-targets -- -D warnings: clean.a_refused_event_is_made_again_under_the_same_request_id,each_event_names_itself_apart,a_cloud_that_stays_down_is_waited_on_once.Risk
A turn refused with a 5xx now waits the wire's backoff (about 1 s, 2 s, 4 s) before the next turn is read; bounded to one turn per outage.
How to revert
Revert the one commit.
Not in this PR
The link the run prints (
https://hanzo.ai/tabs/<session id>) lands on the Tabs landing page: Tabs has no route for a session id. Left for a separate change.