Skip to content

feat(continuation): swap diagnostic :reach/:skip for :noop debug breadcrumbs (#580 cleanup)#173

Merged
karmafeast merged 3 commits intoflesh_beast_figs/20260414-claudefrom
ronan/580-noop-debug-breadcrumbs
Apr 19, 2026
Merged

feat(continuation): swap diagnostic :reach/:skip for :noop debug breadcrumbs (#580 cleanup)#173
karmafeast merged 3 commits intoflesh_beast_figs/20260414-claudefrom
ronan/580-noop-debug-breadcrumbs

Conversation

@ronan-dandelion-cult
Copy link
Copy Markdown

What

Adds log.debug breadcrumbs at each of the three silent return null paths inside checkContextPressure() so future diagnostics can disambiguate from a journal grep without source-reading.

Why

#580 (:reach/:skip/:fire observability) confirmed the outer guard is reachable every turn (75 :reach on ronan, 1+ on cael in 36-min windows) but :fire was 0. Cael's investigation found the actual mechanism: dedup-band-zero collision (?? 0 collides with band===0 so first sub-25% crossing dedups silently). PR #172 fixes that behavior with the sentinel ?? -1.

This PR is the complementary observability fix: even after #172 lands, the three null-return paths are still silent except for :reach/:skip at the outer boundary. If a future cascade lands us in the :noop region, we currently have no journal trace explaining which of the three paths swallowed the call. This PR makes each path leave a one-line breadcrumb:

  • reason=window-zerocontextWindow <= 0 guard (line 64)
  • reason=below-thresholdratio < threshold guard (line 87)
  • reason=band-dedupband === previous dedup suppression (line 98)

After both PRs land + redeploy, a grep on [context-pressure:noop] will surface exactly which suppression path hit each turn, and the field selectors (band=, previous=, ratio=, threshold=) make it filterable.

Coverage

Existing 10/10 tests in context-pressure.test.ts continue to pass — no behavior change, only added debug-level emission.

Conflict with #172

None. #172 changes line 99 (?? 0?? -1) inside lastFiredBand.get(). This PR adds 9 lines around the three null-returns. Verified clean three-way merge:

$ git merge --no-commit --no-ff pr-172
Auto-merging src/auto-reply/continuation/context-pressure.ts
Automatic merge went well; stopped before committing as requested

Either order of merge is fine.

Lane

Trigger

Same upstream issue: bootstrap#580 / openclaw#172. Lane split agreed in channel 17:15 PDT 2026-04-18.

…paths in checkContextPressure (#580)

Adds log.debug emission at each of the three silent null-returns in
checkContextPressure() so future diagnostics can disambiguate from a
journal grep without source-reading:

- reason=window-zero  (contextWindow <= 0 guard)
- reason=below-threshold (ratio < threshold guard)
- reason=band-dedup   (band === previous, dedup suppression)

Pairs with PR #172 (sentinel fix for dedup-band-zero collision):
- #172 fixes the *behavioral* bug (band=0 now fires once on first crossing)
- this PR fixes the *observability* bug (the three silent paths now leave
  a trace in the journal so future cascades like #580 are one-grep visible)

Different file regions from #172, no merge conflict.

No behavior change; debug-level logging only. Fleet-confirmed need:
75 :reach / 0 :skip / 0 :fire window on ronan + 1 :reach / 0 :skip / 0
:fire on cael with no breadcrumb explaining which null path was taken.
…agent-runner (#580 cleanup)

PR #171 added info-level :reach + debug-level :skip breadcrumbs to the
context-pressure outer guard to investigate the silent-fire-failure of
#580. Investigation complete (root cause: dedup-band-zero collision,
fixed by PR #172). Per figs's request: remove the diagnostic scaffolding
so it doesn't ship long-term.

Removed:
- :reach info-level log at agent-runner.ts:1194 (entire reach-breadcrumb block + comment)
- :skip debug-level log at agent-runner.ts:1225 (entire else-branch + skipReason resolution + duplicate logger import)

Kept:
- :fire info-level emit inside checkContextPressure (operational, not diagnostic)
- :noop debug-level breadcrumbs at the three null-return paths (operational future-cascade visibility, this PR's earlier commit)

Net: 22 lines removed, 9 lines added across both commits in this PR.
Pairs cleanly with PR #172 (sentinel fix). 10/10 context-pressure tests pass.
@ronan-dandelion-cult ronan-dandelion-cult changed the title feat(continuation): debug breadcrumbs at three :noop paths in checkContextPressure (#580) feat(continuation): swap diagnostic :reach/:skip for :noop debug breadcrumbs (#580 cleanup) Apr 19, 2026
@karmafeast karmafeast requested a review from Copilot April 19, 2026 00:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates continuation context-pressure observability by removing the outer :reach/:skip diagnostics and instead emitting log.debug breadcrumbs at each of the three internal return null (“noop”) paths in checkContextPressure(), so operators can identify which suppression path occurred via journal grep.

Changes:

  • Removed :reach info log and :skip debug log from the context-pressure pre-run injection block in runReplyAgent.
  • Added [context-pressure:noop] debug breadcrumbs for contextWindow<=0, ratio<threshold, and band dedup suppression paths inside checkContextPressure().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/auto-reply/reply/agent-runner.ts Removes outer guard reach/skip logging around context-pressure injection.
src/auto-reply/continuation/context-pressure.ts Adds debug breadcrumbs to disambiguate which internal noop return path was taken.

Comment thread src/auto-reply/continuation/context-pressure.ts Outdated
Comment thread src/auto-reply/continuation/context-pressure.ts Outdated
Comment thread src/auto-reply/continuation/context-pressure.ts Outdated
Three Copilot suggestions applied to checkContextPressure:

1. Guard log.debug calls with log.isEnabled("debug") at all three
   noop sites (window-zero, below-threshold, band-dedup) to avoid
   eager string interpolation when debug logging is off — these are
   per-turn hot-path emissions.

2. Below-threshold breadcrumb now logs raw ratio/threshold (4dp)
   alongside the rounded percent, so the line stays unambiguous when
   rounded values would coincide (e.g. ratio=0.0599, threshold=0.06
   would both round to 6%).

3. (window-zero and band-dedup paths only needed the isEnabled
   guard; their values are already disambiguating.)

Tests: 10/10 pass. Behavior unchanged when debug is enabled; perf
improved when debug is disabled.

Co-authored-by: Copilot <copilot@github.com>
@karmafeast karmafeast merged commit e0ba8f8 into flesh_beast_figs/20260414-claude Apr 19, 2026
2 of 9 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 19, 2026
… not unrelated

Cael's PR #194 review nit: the breadcrumb work and the dedup-sentinel-collision
fix are causally linked — the noop breadcrumbs (#164, #173) are what made the
silent dedup-suppression visible, which is what enabled #171/#172. Calling it
'unrelated' obscures that chain.

Reword: 'Follow-on work then identified and fixed a second suppression cause
that the new breadcrumbs made visible.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants