Stop showing a request for a secret the run that asked has outlived - #457
Open
kevin9327 wants to merge 1 commit into
Open
Stop showing a request for a secret the run that asked has outlived#457kevin9327 wants to merge 1 commit into
kevin9327 wants to merge 1 commit into
Conversation
An unanswered ask to take the wheel stops being shown after ten minutes, because control belongs to the computer rather than to a conversation. The secret request on the same state machine had no expiry at all, and the surface lights the same "needs you" on both, so a Bot stayed flagged and every later conversation showed a masked box wanting a password for a run that had ended. It expires on the same window, on read, and pendingSecret checks it too so a prompt that has stopped being shown stops being answerable at the same moment.
kevin9327
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
September 8, 2026 22:42
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
An unanswered request to take the wheel stops being shown after ten minutes, because control belongs
to a Bot's computer rather than to a conversation. The other prompt held on that same state machine —
the masked box a Bot opens when it needs one value it must not be told — was never given the same
treatment.
requestSecretrecords no time at all, so nothing expires it: it is cleared only when thevalue lands, or when somebody takes the wheel and hands it back.
The surface does not tell the two apart.
app/src/components/computer/needs-you.tslights the same"needs you" on either:
So the fix for the ask left the half that asks for a password behaving exactly as the ask used to: the
run that made it has ended, and every later conversation with that Bot is flagged and shows a request
captioned with a label written for whoever asked half a day earlier.
It is also the prompt where being stale matters more than being untidy. Answering it types a value
into a field named by a ref from a snapshot the browser has long since moved past — deliberately with
no generation check, on the reasoning that a ref resolves only against the most recent snapshot —
which is a sound argument inside the run that asked and not one about a request from an hour ago.
The change
A private
secretRequestedAtin the closure, anddropStaleSecret()on read. Kept offControlStatebecause nothing outside needs it, and because the existing test that pins the exact set of
secret*keys in the published state is right to pin them.
Expired from
pendingSecret()as well as fromget(), not only from the path the surface polls:pendingSecretis what/human/secretasks before it types, so a prompt that has stopped being shownhas to stop being answerable at the same moment.
SECRET_REQUEST_TTL_MSis the same ten minutes, named separately because they are two prompts andshortening one should not silently shorten the other.
Fail before, pass after
The tests were written first, then
agent-computer/src/control.tswas reverted tomainwithgit checkout HEAD -- agent-computer/src/control.ts:With the fix restored:
Guard against over-correcting. The fourth new test, "is still shown, and still answerable, inside
the window", passes before and after: five minutes in, the label is still there and
pendingSecretstill returns the field, so this shortens nothing that was working. "A fresh request after a stale
one" is the other direction — the expiry has to clear its own bookkeeping, or a Bot that asked twice
would be answerable neither time. Every existing test in the file passes unchanged, including
"a FAILED attempt leaves the request open" and "handing the wheel over or back closes any pending
secret".
Verification
The 20 failures are identical on
mainand on this branch:shell.test.tsspawns/bin/bashandworkspace.test.tscreates symlinks, and this Windows machine can do neither. Nothing here toucheseither file.
Note
The changelog entry sits at the top of
## Unreleasedand shares that anchor with other open PRs, soit may need a one-line rebase.