feat(session-flow): add usage-limit reset checker for keep-going - #2462
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 2m 15s —— View job Security Review
This PR adds a small, self-contained Python CLI ( Findings IMPORTANT — documented invocation interpolates untrusted text into a shell command (moderate confidence)
python3 "${CLAUDE_PLUGIN_ROOT}/skills/keep-going/scripts/check-usage-limit-reset.py" "<limit message text>"
In the common case this text is Anthropic's own system-generated limit banner, so the practical exploit window is narrow. But the skill explicitly targets the orchestration case — inspecting "a worker or subagent" and acting on "its real output" — and keep-going's own doctrine elsewhere is "read the real output first." If that output is ever paraphrased/relayed through content the worker processed (e.g. logs, transcripts, or text influenced by external/adversarial input the subagent handled), a crafted string designed to look like a reset clause but containing shell metacharacters could achieve command injection when the orchestrating agent copies it into the shown command form. The script already supports a safer alternative — reading the message from stdin when no positional argument is given ( printf '%s' "$LIMIT_MESSAGE" | python3 "${CLAUDE_PLUGIN_ROOT}/skills/keep-going/scripts/check-usage-limit-reset.py"Considered, not a real issue: No other issues found: the script does no file I/O, network calls, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c01ae0cd24
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
bdcdcc2 to
ef10475
Compare
|
Claude finished @kyle-sexton's task in 2m 1s —— View job Security Review
Reviewed all 5 files changed in this PR ( Findings IMPORTANT — documented invocation interpolates untrusted text into a shell command (moderate confidence)
python3 "${CLAUDE_PLUGIN_ROOT}/skills/keep-going/scripts/check-usage-limit-reset.py" "<limit message text>"
The realistic exploit path is narrow (the text is normally Anthropic's own system-generated banner), but the skill explicitly targets the orchestration case — inspecting a worker/subagent's "real output" and acting on it, per keep-going's own doctrine. If that output is ever relayed through content the worker processed (logs, transcripts, text influenced by external/adversarial input), a string crafted to look like a reset clause but carrying shell metacharacters becomes command injection the moment an orchestrating agent copies it into the shown command form. The script already supports a safe alternative — reading from stdin when no positional argument is given ( printf '%s' "$LIMIT_MESSAGE" | python3 "${CLAUDE_PLUGIN_ROOT}/skills/keep-going/scripts/check-usage-limit-reset.py"Considered, not a real issue: No other issues found: the script does no file I/O, network calls, Note: two P2 findings from the Codex review on this PR (midnight-rollover date handling, timezone-less input assumed as UTC) are logic/correctness bugs in the reset calculation, not security vulnerabilities (no authorization bypass, injection, or data exposure) — out of scope for this security-only pass. |
|
Claude finished @kyle-sexton's task in 4m 0s —— View job Code Review
Reviewed all 5 changed files against Findings (posted as inline comments)
Findings 1–3 line up with (and were independently verified beyond) the No other issues found. Note on verification: I was unable to execute |
ef10475 to
87a95e2
Compare
|
Claude has reviewed this PR 2 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
|
Claude finished @kyle-sexton's task in 1m 33s —— View job Security Review
Reviewed all 5 files changed in this PR ( Findings IMPORTANT — documented invocation interpolates untrusted text into a shell command (confidence: moderate)
python3 "${CLAUDE_PLUGIN_ROOT}/skills/keep-going/scripts/check-usage-limit-reset.py" "<limit message text>"
The realistic exploit path is narrow (the text is normally Anthropic's own system-generated banner), but the skill explicitly targets the orchestration case — inspecting a worker/subagent's "real output" and acting on it, per keep-going's own doctrine of reading real output rather than trusting a summary. If that output is ever relayed through content the worker processed (logs, transcripts, text influenced by external/adversarial input the subagent handled), a string crafted to look like a reset clause but carrying shell metacharacters becomes command injection the moment an orchestrating agent copies it into the shown command form. The script already supports a safe alternative — reading from stdin when no positional argument is given ( printf '%s' "$LIMIT_MESSAGE" | python3 "${CLAUDE_PLUGIN_ROOT}/skills/keep-going/scripts/check-usage-limit-reset.py"Considered, not a real issue: No other issues found: the script does no file I/O, network calls, Note: the two P2 findings from the Codex review on this PR (midnight-rollover date handling, timezone-less input assumed as UTC) are logic/correctness bugs in the reset calculation, not security vulnerabilities (no authorization bypass, injection, or data exposure) — out of scope for this security-only pass. |
d35eb56 to
3b0f068
Compare
|
Claude finished @cursor[bot]'s task in 2m 3s —— View job Security Review
Reviewed all 6 files changed in this PR ( Findings IMPORTANT — documented invocation interpolates untrusted text into a shell command (posted inline on The documented example still substitutes python3 "${CLAUDE_PLUGIN_ROOT}/skills/keep-going/scripts/check-usage-limit-reset.py" "<limit message text>"Double quotes don't neutralize Considered, not a real issue:
No other issues found: the script performs no file I/O, network calls, |
13df258 to
688be81
Compare
|
Last security-reviewed head: |
Fixes #1321 Ships a small script that parses the resets clause from a limit message and reports lifted vs blocked, wired into the keep-going skill contract. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Handle post-midnight evening resets, anchor timezone-less clauses to the caller's offset, and wire the Python unittest through a .test.sh wrapper. Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
b248aff to
0aebfd3
Compare
|
Claude finished @kyle-sexton's task in 1m 10s —— View job Security Review
Skip gate applied — no security-relevant change since the last completed review. The last completed security review on this PR ran at That's setting the executable bit on the two test scripts — no content change, no new security-relevant surface. Per this lane's skip gate ("this head already has a successful security review that still applies"), I'm not re-running a full pass or re-posting duplicate findings. For reference, the still-open finding from the
No new findings on this head. |
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
|
Claude finished @kyle-sexton's task in 31s —— View job Code Review
Skip gate triggered: this PR is already merged (PR State: MERGED). Per |
…presence-gated (#2514) ## Summary Settles the plugin-wide decision #1602 recovered from closed #1571/#1479: **session-flow skills consume the context-guard zone seam**, presence-gated. The decision was already half-made on `main` — `handoff` names the zone report as one of its three licensing signals, and the `workflow` continuation router resolves the zone word per the reader contract — but the three remaining skills whose correctness depends on window degradation still made that call blind. This PR wires them, each at the exact point the issue named: - **`keep-going`** (decides whether continuing *in this session* is right): a new "Zone input (presence-gated, conservative)" section before step 5's continuation — recovery steps stay evidence-gated regardless, but a degraded or evidence-degraded window routes the continuation toward `/session-flow:handoff` instead of pushing judgment-heavy work through it. - **`running-retro`** (re-enters long sessions to judge degradation): the subjective-state note now carries the measured zone word next to the self-read, records `unknown` honestly, and notes the evidence-degraded marker — which outranks a healthy-feeling self-impression. - **`orchestrate`** (decides how much to fan out): imperative 1's "would flood context" trigger becomes a measurement when the instrument exists — resolve the word before a fan-out decision; degraded/`unknown` shifts toward delegating context-heavy legs and shrinking returns. All three consumption sites follow the established house pattern: resolve per `context-guard`'s reader contract (which owns the snapshot path, staleness rule, and bands — pointed at, never restated), consume only the zone word, inline **no** band values, and treat absent-plugin / absent-snapshot / `unknown` as degraded. Each site explicitly forbids self-estimating the window — the motivating incident was a session reporting "around 40%" while a four-minute-old snapshot read 15% and `context-zone.sh` returned `smart`. Version `0.22.4` → `0.23.0` (additive behavior guidance; `0.22.5` is claimed by in-flight #2462 — skipped past it per the #1746 collision pattern; no file overlap with that PR's keep-going edit, which touches the usage-limit section). ## Test plan - `npx markdownlint-cli2@0.23.2` on all four edited markdown files — 0 issues. - Instruction-surface-only change; no scripts or hooks. Conformance points to verify by read: no band values, paths, or staleness numbers are inlined anywhere in the three edits (grep `smart|acceptable|dumb` in the diffs returns only the vocabulary word `unknown` and the word "degraded"), matching the reader contract's consumption discipline the `workflow` router established. ## Related Fixes #1602 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Fixes #1321
Adds
check-usage-limit-reset.pyso keep-going can compare a worker's stated reset time to the clock without model arithmetic.Test plan
python3 check-usage-limit-reset.test.py(3 cases)Related