Skip to content

fix(commands): emit WARN when bootstrap files are truncated - #68307

Closed
1aifanatic wants to merge 2 commits into
openclaw:mainfrom
1aifanatic:fix/bootstrap-truncation-warn-68233
Closed

1aifanatic wants to merge 2 commits into
openclaw:mainfrom
1aifanatic:fix/bootstrap-truncation-warn-68233

Conversation

@1aifanatic

Copy link
Copy Markdown

Summary

  • resolveCommandsSystemPromptBundle was calling resolveBootstrapContextForRun without a warn callback
  • Bootstrap file truncation warnings were silently discarded in the commands / system-prompt path
  • Wires up makeBootstrapWarn backed by a createSubsystemLogger so truncation warnings now surface at WARN level, consistent with the compact and attempt runner paths

Test plan

  • resolveCommandsSystemPromptBundle is called with a large bootstrap file exceeding bootstrapMaxChars
  • A WARN log entry workspace bootstrap file ... is N chars (limit M); truncating in injected context (sessionKey=...) appears
  • No regression: existing tests for resolveCommandsSystemPromptBundle still pass (the mock uses objectContaining, so the new warn field is ignored)

resolveCommandsSystemPromptBundle was calling resolveBootstrapContextForRun
without a warn callback, so bootstrap file truncation warnings were
silently discarded in the commands / system-prompt path.

Wire up makeBootstrapWarn backed by a subsystem logger so that
truncation warnings surface in the log at WARN level, consistent with
the compact and attempt runner paths.
@greptile-apps

greptile-apps Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR wires up the missing warn callback in resolveCommandsSystemPromptBundle so that bootstrap file truncation warnings are now emitted at WARN level via a subsystem logger, matching the pattern already in place for the compact and attempt-runner paths. The change is minimal and consistent with existing callers.

Confidence Score: 5/5

Safe to merge — small, additive fix with no behavioral changes to existing paths.

The change strictly adds a previously missing warn callback using the same well-tested makeBootstrapWarn pattern found in compact.ts, attempt.ts, and prepare.ts. No logic is altered; only a silent discard is replaced with a log.warn call. No P1 or P0 findings.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(commands): emit WARN when bootstrap ..." | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open: current main still calls the bootstrap resolver from the commands system-prompt path without a warning callback, so the branch carries a useful narrow bug fix. It is not merge-ready because GitHub reports the branch as conflicting, the external PR lacks after-fix real behavior proof, and it edits release-owned changelog content.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main calls resolveBootstrapContextForRun from resolveCommandsSystemPromptBundle without warn, while the bootstrap resolver only emits truncation warnings through that optional callback. I did not run a live command-path repro because this cleanup review is read-only.

Is this the best way to solve the issue?

Yes, the code direction is the narrowest maintainable fix: reuse makeBootstrapWarn on the commands prompt path like the compact, attempt, and prepare paths. The submitted branch still needs rebase cleanup, proof, and removal of the release-owned changelog edit before it is merge-ready.

Security review:

Security review cleared: No concrete security or supply-chain concern was found; the diff only changes internal warning logging, a test mock, and release-note text.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-17T22:38:04Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • steipete: Recent command prompt and agent runtime history includes multiple changes to the commands system-prompt path and adjacent agent runtime surfaces. (role: recent area contributor; confidence: high; commits: a66462b58368, bb46b79d3c14, 02182d5a3031; files: src/auto-reply/reply/commands-system-prompt.ts, src/agents/bootstrap-files.ts)
  • rubencu: Authored the merged work that added deduped makeBootstrapWarn, the helper this PR reuses for the missing commands warning sink. (role: bootstrap warning helper contributor; confidence: high; commits: 7e18c07e410c; files: src/agents/bootstrap-files.ts, src/agents/bootstrap-files.test.ts)
  • gumadeiras: Authored the unified bootstrap truncation warning handling that established the broader warning/reporting behavior this PR extends. (role: original bootstrap truncation warning contributor; confidence: high; commits: e4b4486a96a9; files: src/agents/bootstrap-budget.ts, src/auto-reply/reply/commands-context-report.ts)
  • BunsDev: Added per-agent bootstrap profile handling across command diagnostics and runtime paths, directly adjacent to the agent-aware bootstrap arguments in this PR. (role: bootstrap profile contributor; confidence: medium; commits: 930852af2959; files: src/auto-reply/reply/commands-system-prompt.ts, src/agents/bootstrap-files.ts)
  • Takhoffman: Recent bootstrap prompt routing work touched embedded bootstrap behavior and is adjacent to warning propagation through runtime bootstrap resolution. (role: bootstrap routing contributor; confidence: medium; commits: 62703d84308a; files: src/agents/bootstrap-files.ts, src/agents/embedded-agent-runner/run/attempt.ts)

Codex review notes: model internal, reasoning high; reviewed against 4e6933c84f18.

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 7, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels May 19, 2026
@clawsweeper

clawsweeper Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels Jun 6, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 7, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(commands): emit WARN when bootstrap files are truncated This is item 1/1 in the current shard. Shard 13/22.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jul 19, 2026
@steipete

Copy link
Copy Markdown
Contributor

Closing per ClawSweeper review verdict stalled_unproven_pr (decision packet 2026-07-18T06:06:58.656Z). This item was part of the audited close backlog (openclaw/clawsweeper#920) stranded by an apply-lane defect, drained manually after re-verification. If this is wrong, reopen and ClawSweeper will re-review.

@steipete steipete closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants