tests(continuation/X5.1): add request-compaction-tool.test.ts β resolves bootstrap#542#165
Merged
ronan-dandelion-cult merged 1 commit intoflesh_beast_figs/20260414-claudefrom Apr 18, 2026
Conversation
Resolves swim-34/X5.1 (karmaterminal/openclaw-bootstrap#542). Covers all six cases the spec asks for, plus four edge-case additions that close the fencepost ambiguity the issue flagged: Spec cases: (a) ToolInputError when session is absent (both agentSessionKey and sessionId separately). (b) context_threshold guard rejects when usage < MIN_CONTEXT_THRESHOLD. (c) Enqueues compaction when usage >= MIN_CONTEXT_THRESHOLD with no rate limit. (d) rate_limit guard rejects when called again within RATE_LIMIT_MS. (e) [already-pending] short-circuits with status=already_pending and does not re-enter triggerCompaction. (f) Documented status markers (compaction_requested / rejected / already_pending) are stable. Edge cases: - 69% is still rejected (just-below-floor). - Exactly 70% is accepted (inclusive-floor β resolves the ">70 vs >=70" fencepost ambiguity from the issue body: source uses `<` for reject, so 70% exactly is accept). - A fresh request after RATE_LIMIT_MS elapses is accepted again. - agentSessionKey and sessionId each fail independently with ToolInputError. Uses the exported test helpers (_resetGuardState, _setPending, _resetVolitionalCounts, _guards) from the source module β no internal-state poking, no prototype mutation. Run: `pnpm test src/agents/tools/request-compaction-tool.test.ts` β 10 passed, 553ms. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
394734e to
8f9e380
Compare
cael-dandelion-cult
approved these changes
Apr 18, 2026
cael-dandelion-cult
left a comment
There was a problem hiding this comment.
π©Έ LGTM. 193-line test file covers ToolInputError, threshold guards (including 69% boundary), enqueue paths β proper boundary discipline. Uses _resetGuardState/_resetVolitionalCounts in before/after, restoreAllMocks. Resolves bootstrap#542 cleanly. Ship it.
32118f7
into
flesh_beast_figs/20260414-claude
2 of 10 checks passed
ronan-dandelion-cult
pushed a commit
that referenced
this pull request
Apr 19, 2026
β¦le + status restoration Updates RFC docs/design/continue-work-signal-v2.md to reflect the totality of changes since 107ca2b (the prior RFC edit) plus the two ship-gate PRs about to land: - Β§4.3: document session provider/model threading through volitional compaction (openclaw#191 / bootstrap#639). Three coupled defects: root cause, caller-honesty (phantom-counter), visibility (`unknown_model` classifier + `isLegitSkipReason` helper + `log.warn` on resolve-with-fallback + scope-aware `authProfileId`). - Β§6.1: add `[context-pressure:noop]` log anchor with reason taxonomy (window-zero / below-threshold / band-dedup); document the bootstrap#580 investigation cycle (`:reach`/`:skip` instrumentation, root cause = sentinel collision on band 0, fix = -1 sentinel). - Β§6.3: clarify Discord/agent path through src/auto-reply/status.ts was reconnected at openclaw#187 + tested at #188 (the line had been silently dropped in an earlier refactor); note `volitional: N` is honest only after #191. - Β§6.4: replace 'instrumentation is not currently in place' note with status of distinguishing-instrumentation work (openclaw#164/171/172/173). - Appendix C.1: add 'Closed failure modes' table β phantom-counter, hedge-timer ref leak, band-0 dedup, precondition-skip blindness, Copilot summarization headers, dist-bundle satellite chunks, subagent-announce runtime path mismatch. - Appendix D.2: add evidence-location rows for the new file paths (volitional threading sites; armHedgeTimer; status renderer; request-compaction-tool tests; context-pressure noop sites; agent-runner runtime promotion; subagent-announce co-location; F-NOISE scheduler test). - Header: bump test count (~180 across 13 files, was '172 across 8') to reflect additions in #165, #170, #188, #193. Skip-list (no RFC mention): #174 sessions/config raw-key sweep (internal hygiene); #173 Copilot log-enabled nits (micro-hygiene); 86134af removal of investigation breadcrumbs (cycle is folded into Β§6.1 narrative). Refs: openclaw#191 head fc3f415 (in-flight, MERGEABLE/UNSTABLE, APPROVED) openclaw#193 head 14483a6 (in-flight, MERGEABLE/UNSTABLE, APPROVED x2) openclaw#187, #188 (merged d787890) openclaw#160, #162, #164, #165, #169, #170, #171, #172, #173, #174 π in π©²: this is a docs PR; if either #191 or #193 changes shape pre-merge the affected paragraph here will need a one-line touch-up. Co-Authored-By: dandelion cult - ronan π <karmafeast@gmail.com>
ronan-dandelion-cult
pushed a commit
that referenced
this pull request
Apr 26, 2026
- L921: drop 'As of canonical2 <sha>' dev-state preamble; spec target reads independent of canonical2 marker - L1343: drop 'swim-34/X5.1' cohort codename from #165 entry Addresses π« walker-2 holdout (#issuecomment-4323337991). Mirror of cohort-label-strip pass; final upstream-presentable polish.
cael-dandelion-cult
pushed a commit
that referenced
this pull request
Apr 27, 2026
β¦urrent capability incorporation (#358) * chore(rfc-fixup): initialize lane journal Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(rfc-fixup): record source pre-read Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): regenerate continuation ToC Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): strip continuation process metadata Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(rfc-fixup): note targetSessionKey state Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): incorporate current continuation surfaces Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): finalize continuation consistency pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): record verification receipts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(rfc-fixup): note final gate rerun Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: drop tmp-drop-me-gpt2-rfc-fixup.md scratch artifact Mirror of #354 path-b cleanup (commit 2d6a734). Scratch worker artifact must not land on upstream-presentable RFC PR. * docs(rfc-fixup): strip remaining cohort/dev-state nouns - L921: drop 'As of canonical2 <sha>' dev-state preamble; spec target reads independent of canonical2 marker - L1343: drop 'swim-34/X5.1' cohort codename from #165 entry Addresses π« walker-2 holdout (#issuecomment-4323337991). Mirror of cohort-label-strip pass; final upstream-presentable polish. * docs(rfc-fixup): re-pad table column on L1343 after cohort-label strip oxfmt --check failure on a079b04: removing ', swim-34/X5.1' (16 chars) left the trailing-whitespace pad on L1343 mis-aligned with the rest of the column. pnpm format:docs:check passes locally after this re-pad. Pure cosmetic; no semantic change. Addresses π« walker-2 #issuecomment-4323345225. --------- Co-authored-by: Test User <test@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ronan π <ronan@solidor.io>
karmafeast
pushed a commit
that referenced
this pull request
May 1, 2026
β¦urrent capability incorporation (#358) * chore(rfc-fixup): initialize lane journal Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(rfc-fixup): record source pre-read Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): regenerate continuation ToC Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): strip continuation process metadata Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(rfc-fixup): note targetSessionKey state Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): incorporate current continuation surfaces Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): finalize continuation consistency pass Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(rfc): record verification receipts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore(rfc-fixup): note final gate rerun Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: drop tmp-drop-me-gpt2-rfc-fixup.md scratch artifact Mirror of #354 path-b cleanup (commit 2d6a734). Scratch worker artifact must not land on upstream-presentable RFC PR. * docs(rfc-fixup): strip remaining cohort/dev-state nouns - L921: drop 'As of canonical2 <sha>' dev-state preamble; spec target reads independent of canonical2 marker - L1343: drop 'swim-34/X5.1' cohort codename from #165 entry Addresses π« walker-2 holdout (#issuecomment-4323337991). Mirror of cohort-label-strip pass; final upstream-presentable polish. * docs(rfc-fixup): re-pad table column on L1343 after cohort-label strip oxfmt --check failure on a079b04: removing ', swim-34/X5.1' (16 chars) left the trailing-whitespace pad on L1343 mis-aligned with the rest of the column. pnpm format:docs:check passes locally after this re-pad. Pure cosmetic; no semantic change. Addresses π« walker-2 #issuecomment-4323345225. --------- Co-authored-by: Test User <test@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ronan π <ronan@solidor.io>
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
Implements swim-34/X5.1 test authoring per karmaterminal/openclaw-bootstrap#542. New file `src/agents/tools/request-compaction-tool.test.ts`, 10 tests (all passing).
Scope
All six cases called out in #542 plus four edge cases that close the `>70` vs `>=70` fencepost ambiguity the issue body flagged:
Fencepost resolution
Source is `if (contextUsage < MIN_CONTEXT_THRESHOLD) { reject }` β so exactly 70% is accepted (inclusive floor). Tests 4 + 6 pin that. The spec's prose wobbled between `>70` and `>=70`; the source is the source of truth and the spec can match it going forward.
Uses existing test helpers
All state manipulation goes through the exported `_resetGuardState`, `_setPending`, `_resetVolitionalCounts`, and `_guards` helpers from the source module β no internal-state poking, no prototype mutation, per the repo testing guide.
Run it
```
pnpm test src/agents/tools/request-compaction-tool.test.ts
β 10 passed, 553ms
```
Out of scope
π€ Generated with Claude Code