Results of a tool-call batch arrive together after one call waits for approval, so the agent treats hours-old output as current
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
Windows + WSL2 (Linux 6.6.114.1-microsoft-standard-WSL2), Kiro IDE remote server running in WSL
Kiro Version
Kiro IDE 1.1.571 (commit 9b769672d19454658b99a5875a0db99f559c4c59)
Bug Description
When the agent issues several tool calls in one response and only one of them needs user approval (permission policy ask), the calls that do not need approval run immediately, but all results are handed back to the model together only after the pending call is approved. Nothing in the results tells the model that they were produced at different times, or that one call waited for approval.
If the approval prompt stays unanswered for a long time, the model receives output that is hours old next to output that is fresh, and treats all of it as the current state.
What happened in our session:
- The agent issued three status checks in one response: a local log/
ps/datecheck, a cloud API status query, and ansshstatus check on a remote host. Only thesshcall required approval. - The two local calls ran at once. The
sshcall waited for about 6 h 45 min, because nobody was at the machine, and ran only when it was approved. - The model then received all three results in one turn. The local output said a background job had been running for about 5 minutes, which was its state 6 h 45 min earlier. The remote output carried the current time.
- The model read the two timestamps as clock skew, then as a system sleep. It told the user that the job had made no progress for about 7 hours. In fact the job had been running normally the whole time. The cloud status in the same batch (instances still
stopping) was also stale, and was reported as an anomaly. - The user acted on this false report before the error was found by re-running the checks.
Steps to Reproduce
- Use a permission policy in which a simple read command (for example
date) is allowed and another command (for examplessh, or any command matched by anaskrule) requires approval. - Have the agent run, in a single response:
- call A:
date; sleep 1; date(allowed) - call B: a command that requires approval and prints
date
- call A:
- Do not answer the approval prompt for call B for several minutes, then approve it.
- Compare what the model receives.
Expected Behavior
The model can tell that results in one batch come from different points in time. Any of the following would prevent the failure:
- attach execution start/end times, and the time spent waiting for approval, to each tool result;
- return results that are already complete without waiting for the pending approval, so that stale output does not arrive later as if it were current; or
- when any call in a batch needs approval, ask before running any call in that batch, so that all calls run at the same time.
Actual Behavior
Call A runs at T0. Call B runs at T1, after approval. Both results reach the model together at T1 with no time or approval-wait information, and the model treats call A's T0 output as the state at T1.
Additional Context
- This matters most for long, unattended work, where approval prompts are likely to go unanswered for hours and status checks are the main thing the agent does.
- Related but distinct: #12116 (the agent batches dependent tool calls) and #11098 (concurrent tool results presented out of order). This report is about results produced at different times being presented as one snapshot, even when every call is independent and correctly ordered.
Conversation ID
Not available
Thanks for opening this issue and for the thorough write-up — the detailed reproduction scenario really helps! This is a great catch: when tool calls in a batch complete at very different times due to an approval gate, the agent loses track of how stale some results are, which can lead to misleading conclusions. A maintainer will take a look at this soon. We appreciate you taking the time to report this — it's exactly the kind of real-world edge case that helps us improve agent quality! 🙌
Thanks for raising this. The behavior you documented is a real correctness issue: when one call in a batch waits hours for approval, the results from earlier calls arrive at the model with no timestamp context, so the model treats stale output as current state. Your three proposed mitigations (attaching execution times to results, returning completed results without waiting, or holding all calls until approval) are all valid directions, and we are routing this for investigation. Marking this as a bug to investigate further.