fix(supervisor): read the Claude Team org-spend wall and its wrapped reset clock (DIVE-4401) - #921
Merged
Conversation
…reset clock (DIVE-4401)
Two seats on one Claude Team auth profile hit the same wall at 04:31Z on
2026-09-13 and `agent info` disagreed about it: main reported
quotaDeadline=live, olivia reported `unknown` off byte-equivalent reset text.
Both halves of that are pane-reading defects.
1. `_SUP_QUOTA_PAT`'s `hit your <window> limit` arm required the window noun
immediately after `your`. A Team seat prints the possessive form
You've hit your org's monthly spend limit · ask your admin to raise it at
claude.ai/admin-settings/usage · your session limit resets 9am (UTC)
so `org's` sits exactly where the alternation expected `monthly`, and the
ONE line in the Team banner that also carries the reset clock matched no arm
at all. Widened with a single optional non-space qualifier token; the arm
still requires the window noun followed by the literal word `limit`.
2. The deadline was read off the SELECTED line only. The banner is a sentence
and the pane is a fixed width, so the signature and the clock land on
different physical lines whenever it wraps — which is the whole of the
main-vs-olivia disagreement: the same sentence, wrapped differently.
`_sup_quota_match` now keeps the whole pane and, when a selected match
carries no parseable deadline of its own, borrows one from an immediate
neighbour.
DIVE-3880's stale-scrollback false positive stays closed: only an UNKNOWN
match is ever extended, the neighbour must satisfy `_sup_quota_deadline` (so a
bare `resets 9am` cannot join), a neighbour that is itself a signature is
skipped as a separate banner, and the scan is nearest-first with forward
preferred at equal distance — a wrapped sentence continues on the line below,
and a backward-first scan hands the newer of two stacked banners the older
one's clock.
tests/supervisor_team_wall_unit.sh — 16 arms over both measured panes, both
wrap shapes, the agreement assertion, two negative controls (prose mentioning
an org spend limit; a bare clock line beside an untimed signature) and the
DIVE-3778 errexit guard. Mutation-proven: reverting the pattern widening reds
3 arms, removing the join reds 6, and neither reds the other's.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both sides rewrite `_sup_quota_match`, and the overlap is semantic, not textual: DIVE-4405 (#923) drops our own echoed alert lines before the pane is matched; DIVE-4401 (#921) keeps the whole pane so an untimed banner can borrow a reset clock from an immediate neighbour. Taking either hunk alone re-opens the other's defect. #923's filter sat immediately in front of the grep, which covers only the line that MATCHES — but the join reads NON-matching lines too, so an echoed alert quoting a reset time would be lent to a real untimed banner. The resolution moves the filter upstream of the pane read (`pane_text=$(_sup_pane_drop_echoes)`), so the array the join scans never contains our own output at all. One call, both doors. tests/supervisor_team_wall_unit.sh +6 arms: an echoed alert is not a wall; an echoed neighbour cannot lend its clock; the untimed signature is emitted unjoined; a positive control (the same neighbour unmarked DOES join, live, at the banner's 9am) so the pair cannot pass on a function that never joins; and the DIVE-3778 errexit contract re-asserted on an all-echo pane, which is the path where grep -v drops every line. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Delivers DIVE-4401.
Opened by
5dive push --open-pr(DIVE-2605): the branch and this pull request went out on the same root-side rail, as 5dive-bot. The authoring agent holds no GitHub credential.ops (DIVE-4422): the
titlecheck was red on the pre-retitle payload and a re-run replays that old payload, so this body touch fires a freshpull_request: editedto re-grade the current (conventional) title. No code change.