Repository navigation
fix(always_on): the user's response time holds the agent's messages, not her answer (FD-7185) - #1011
Merged
sarah-chitty-1 merged 2 commits intoDec 5, 2026
Conversation
…not her answer (FD-7185) The user sim read at her first look and its answer was held for her response time. A message the agent sent in that hour was read only when the held answer went out, so the old answer reached the agent after the newer message and read as an answer to it: the concert task's "yes, buy them" for $124.66 seats arrived after a $480.83 VIP offer, and the agent bought VIP. Now she looks as before (same time, same mode), her response time runs, then she reads everything sent by then and her answer goes out at once, labelled with the time she wrote it. An answer due during an agent turn is written at its time with what was sent, and what her phone got, by then; later messages wait for her next look. A single message gets its answer at the same time, in the same wake, with the same label as before; only the read's recorded time moves to the answer time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d the last read is one read (FD-7185) - A due answer is read in the loop whatever end_time is, and one due at end_time itself is read before the final check-in, so it reaches the agent with it, as a held reply due by then always did. - The last read is a single read, within its cap and the closing's room for one. - No last read after her answer ended the run (a done with no message, the user sim gate's "end"). - Tests: 15 single-message cases now pin every wake, the label and the pending record, the same on main and here; new end-of-run cases for the final turn, the time budget's closing and an answer that ends the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kaihackney-scale
approved these changes
Dec 5, 2026
sarah-chitty-1
deleted the
sarahchitty/fd-7185-always-on-a-held-user-sim-reply-arrives
branch
December 5, 2026 02:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes FD-7185: in always_on runs, a user-sim answer held for the user's response time arrived after the agent's newer message and read as an answer to it.
The bug
The user sim read the agent's message at once, and agent-env held its answer for her response time (60 min at work in the concert task). A message the agent sent in that hour was read only when the held answer went out. So the old answer reached the agent after the newer message, stamped with the delivery time, and nothing said which message it answered.
In
psi-ts-gatelark-new-country-act(v13 and v14, Gemini and Opus): at 10:05 the sim wrote "yes, buy them" for $124.66 seats, held to 11:05. At 10:27 the seats had sold out and the agent offered VIP at $480.83. At 11:05 the stale "yes" arrived and the agent bought VIP. This decided three runs.The fix: the wait holds the agent's messages, not her answer
response_times): unchanged.on_fail: "end").On by default for every always_on task, with no flag (agreed with Sarah).
What changes for live runs
user_sim_read.virtual_time=deliver_at; the look is in the newlooked_atfield and the newuser_answer_scheduledevent), and she sees phone alerts and her own lines up to then. Her wording can differ from before.max_replies).wake_reserve_seconds) has room for one read, and that is her last read, after the closing turn. Reading her answer before the closing wake too could run past the hub's job.unread_by_user, and she has no held answer, since she hadn't written it yet. Theuser_answer_scheduledevent records when it was due.post_turn_hooksread_atis now the read's time (her answer time), not her look.rate_user_satisfaction's session time moves later by her response time. Nothing in agent-env or synthetic-pipelines readsread_at.last_reply_atguard is gone; it can no longer fire.Tests
tst/unit/task_step/test_always_on_held_replies.py(31 cases):looked_atat the look. Their delivery assertions are unchanged.tst/unit/task_step -k "always_on or user_sim or satisfaction"): 1155 passed.always_on.pyand its tests.Overlap and follow-up
#1003 (FD-7183, fixed clock mode) touches other parts of
always_on.py(clock setup, per-turn reporting,finish, the judge text) and the test harness. It doesn't touch the read and hold code. Its 60 s per tool call makes agent turns longer in task time, so answers due inside a turn become common. Those are tested here. Such an answer still arrives after the turn, labelled with the earlier time, next to the turn's newer messages; only the label shows they crossed. A short note in that wake ("written before your 11:40 message") would make it plain. That's a separate change.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.Summary
Moves the user sim’s response delay before its read, so messages sent during the wait receive one answer together.
Acknowledgments from
sarah-chitty-1: answers written during agent turns may arrive beside newer messages with only their time labels showing the crossing; clearer wake text is deferred. Time-budget closings intentionally record waiting answers as held. Error endings intentionally leave waiting messages unread.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Agent sends a message] --> B[Schedule the user's look] B --> C[Start response time] C --> D[Collect messages sent during the wait] D --> E[Read messages up to answer time] E --> F[Write answer with that time label] F --> G{Run still accepts a wake?} G -->|Yes| H[Deliver answer in a wake] G -->|No| I[Record answer as held] E --> J[Keep later messages for the next look]Reviews (1) · Last reviewed commit: "fix(always_on): an answer due by end_tim..." · Reviewed by Greptile