Repository navigation
feat: commands record what they waited on, and the invite card says what it's doing - #1023
Merged
Merged
Conversation
…hat it's doing
An invite answer once waited ~3.9s before its command started, and nothing
on disk said why: the trace had rotated out, and neither the queue wait
nor short freezes are saved.
Server: every orchestration command runs in one line. Each command now
records, when its turn comes, how long it waited, how many commands ran
ahead of it, how much of the wait went to their work, and how busy the
main loop was (trace span attributes `orchestration.queue_*`). A wait of
1s or more also writes "orchestration command waited in line" to the log,
which outlives the traces, at most once per 5s with a count. Times use the
monotonic clock, work ahead counts only what ran after the command joined
(failure handling included), and the warning is written after the
command's turn so it can never hold it up.
Web: after the user answers an agent's invite, the card replaces its
buttons with what is happening ("Asking X for a review…") until the
thread update removes it. The answer is shared from the click on, so a
card left and reopened while the answer is on its way shows the same line
instead of the choices.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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 answer to an agent's invite once waited about 3.9s on the server before its command started (the command itself took 0.36s). Nothing on disk could say why. The trace had rotated out, the command queue's wait time lives only in an in-memory metric, and the freeze monitor logs only freezes of 5s or more.
Server. Every orchestration command runs in one line, one at a time. Each command now records, when its turn comes:
These go on its trace span as
orchestration.queue_*. A wait of 1s or more also writesorchestration command waited in lineto the log, which keeps weeks of history, at most once per 5s with a count. The next slow click then shows whether it was stuck in line or the server was frozen.Times use the monotonic clock. "Work ahead" counts only work done after the command joined the line, including failure handling. The warning is written after the command's turn ends, so a slow or broken log write can't hold it up.
Web. After the user answers an invite, the card replaces its buttons with a line saying what's happening, until the thread update removes the card. The line keeps the buttons' height, so the card doesn't shift:
The answer is recorded from the click on, so a card left and reopened while the answer is still on its way shows the same line instead of the choices. If the answer fails, the buttons come back with a toast.
Tests. New engine test: a command queued behind a slow write logs the warning, with one command ahead and over 1s of its work. The existing invite browser test is updated, because its expectation changed on purpose: the card used to grey out the buttons and now replaces them with the line. 884 orchestration tests and 26 room tests pass, along with fmt, lint and typecheck.
Review. Reviewed by GPT-6.2-Astra. Fixed: the log write held the command, reopening the card mid-answer brought the buttons back, "work ahead" was miscounted, and the clock could change mid-wait. Kept on purpose: the skipped-warning count includes the current warning.
Not in this PR: any change to how commands are lined up. That waits until these records show what the wait was.