Repository navigation
feat(sessions): the no-output watchdog as a session check, and an on-demand snapshot for the token-refresh sweep (task #211, step 2) - #672
Merged
Conversation
added 10 commits
November 8, 2026 17:08
…ks for the quota scan's checks (task #211, step 1) Signed-off-by: Aixle Flow <[email protected]>
…nd their kept state (task #211) Signed-off-by: Aixle Flow <[email protected]>
…demand snapshot for the token-refresh sweep (task #211, step 2) Signed-off-by: Aixle Flow <[email protected]>
…nd the session's locks, heal counters under the lock, a real-shell snapshot test (task #211, CR round 1) - Sessions::AuthPause#pause! and #unpause! lock the workflow run, then the session, and change the marker and the run's state in one transaction. A delivery can no longer land between the marker and the run's pause, and two sessions of one run unpaused at once resume it. - #resume! returns the unpause's result and logs only what happened. The resume prompt is still typed before the compare-and-set. - #heal! counts its attempt under the session's row lock, re-reading the counter and, from the pass, heal_due? there. - A test runs Snapshot::Command#argv through /bin/sh with stub tmux and stat. Signed-off-by: Aixle Flow <[email protected]>
…es (task #211, CR round 1) Checks::NoOutput#message redacts the whole screen with Sessions::SecretRedactor.for_session before AuthErrorDetector reads it, as LiveLogReader#tail did. Checks::Base#fail_session redacts the final message too, which also covers the quota, blocking-prompt and turn-end messages. Signed-off-by: Aixle Flow <[email protected]>
… and turn-end confirmation, a threaded unpause test (task #211, CR round 2) - Sessions::AuthPause#pause! redacts the banner before storing auth_pause_reason. - #expire! and #unpause_quietly take the auth_paused_at the pass observed and act only if the locked row still holds it; #expire! computes the expiry from the locked row. - Checks::TurnEnd#give_up requires turn_end_screen and turn_end_seen_at to match the confirmation it acts on, under the lock. - The two-sessions-of-one-run unpause test moves to auth_pause_concurrency_test.rb, on two threads with their own connections. Signed-off-by: Aixle Flow <[email protected]>
…ture/session-checks-no-output
…he concurrency test's sessions have a prompt (task #211, CR round 2) Signed-off-by: Aixle Flow <[email protected]>
…ture/session-checks-no-output
|
Thanks for your pull request! Before we can merge it, we need you to sign our Contributor License Agreement. It is a one-time step and covers all your future contributions. To sign, reply to this pull request with exactly: I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
Step 1 (#671) was squash-merged into develop as ed446d4. Conflicts are resolved to step 2's version: develop already holds step 1 exactly, and Signed-off-by: Alex <[email protected]> #670 touched none of the conflicted files.
TemporalService.connection in tests boots WorkflowEnvironment.start_local, the CLI dev server, which the SDK downloaded lazily from temporal.download on every run. A failed download errored whichever test first reached Temporal (4 errors in auth_pause_test.rb on CI run 42609000420). Seed it into TEMPORAL_TEST_SERVER_DIR next to the time-skipping server and point start_local at it. Signed-off-by: Alex <[email protected]>
Merged
aixle-com Bot
pushed a commit
that referenced
this pull request
Nov 10, 2026
Conflicts resolved: - Files touched on staging only by the pre-squash branches of task #209 (PR #669) and task #211 (PRs #667/#668) take develop's version, which carries the reviewed, merged form of the same work (#670, #671, #672). - test/integration/web/company/billing_test.rb: keeps the billing redesign's (#646) test body with develop's 14-day trial values (#678). - CHANGELOG.md: develop's 1.11.0 entry for the 14-day trial; the billing redesign entry already present above is kept once. Signed-off-by: Alex <[email protected]>
4 tasks done
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.
Summary
Step 2 of task #211 (decision 11.2). Step 1 is merged as #671 (
ed446d4dondevelop), and this pull request now targetsdevelop. It moves the no-output watchdog and the token-refresh sweep onto the session monitor that #671 added.Sessions::Checks::NoOutputreplacesSessions::NoOutputWatchdog,Activities::Workflow::ScanNoOutputSessionsActivity,no_output_scan_workflowand its 5-minute schedule. It is the last check inSessions::Monitor::CHECKSand reads the same snapshot as the quota scan's checks, with no exec of its own.SCREEN_RULE_RUNTIMES = %w[kiro_cli]; other runtimes use the log's mtime) and the same messages (expired login, turn end withoutfinish_session, no output).readystep is read from its start.Base#fail_session: a compare-and-set under the row lock.screen_digestandscreen_changed_at, owned by the check and written in the pass's single update.The token-refresh sweep uses an on-demand snapshot (decision 12). Right before it rotates a grant,
RefreshExpiringTokensActivity#parked?reads each holder throughSessions::Monitor.snapshot, which uses the same read path and parts registry as the pass. It then runsChecks::NoOutput#silent_for?(snapshot, IDLE_BEFORE_REFRESH)on that snapshot. The read feeds the same kept record as the passes. A holder that cannot be read still counts as busy.Kept state, now complete
auth_paused_at,auth_pause_reason,auth_renewed_at,auth_heal_attempts,auth_heal_attempted_atturn_end_screen,turn_end_seen_atturn_end_nudgesscreen_digest,screen_changed_atBehaviour changes, each explained
capture-pane -S -40. The two are the same lines unless the shorter capture held fewer than 40 nonblank lines. At the switch-over, such a session's digest changes once and its record restarts from the log's mtime, which only delays a verdict.TurnEndtyped a reminder (:nudged, which stops the pass for that session), the no-output check does not run for that session. A session that was just typed into is not judged silent on the snapshot taken before the typing. Before, the two separate scans could both act within the same minute.Settings.runners.scan_op_timeout(15 s) for a runner holder, as the pass is. Before, it used the 60 s default op timeout. A holder that does not answer still reads as busy.Merge of
developafter #671#671 was squash-merged, so git saw step 1's files as added on both sides.
developwas merged into this branch (a4150009), and every conflict was resolved to step 2's version:developholds step 1 exactly plus #670, and #670 touched none of the conflicted files.git diff origin/develop HEADequals step 2's own diff15f98e2b..42c9c376(23 files, +514/−531), apart from hunk positions indocs/design/agent-runtimes/DESIGN.md.Related issues
Board task #211. Step 1 is #671 (merged).
Type of change
How was this tested?
Ported tests, with the same assertions:
no_output_watchdog_test→test/services/sessions/checks/no_output_test.rb, run through the monitor and the fake runtime instead of a mockedLiveLogReader. It adds tests for the kept record, the auth-pause and interactive skips, and the re-check of a session that startedfinishingduring the read.test/temporal/activities/workflow/monitor_sessions_no_output_test.rb, at the 1-minute cadence. It asserts that the session ends within threshold + 1 minute, and that one exec per pass serves every check.New tests in
refresh_expiring_tokens_activity_test.rb:skipped_busy: 1, no refresh request, the old token is kept, and the read went through the snapshot and fed the record.Targeted runs on Coder after each round are recorded on board task #211.
Docs:
docs/architecture/workflows.md(the no-output check row, the on-demand snapshot, the silence watchdog),docs/design/agent-credential-lifecycle.md,docs/design/agent-runtimes/DESIGN.md(8c now feeds the snapshot source).Checklist
git commit -s).