Skip to content

fix(doctor): bound AGENTS.md and root-memory file reads#101448

Merged
steipete merged 11 commits into
openclaw:mainfrom
cxbAsDev:fix/bound-doctor-workspace-memory-reads
Jul 18, 2026
Merged

fix(doctor): bound AGENTS.md and root-memory file reads#101448
steipete merged 11 commits into
openclaw:mainfrom
cxbAsDev:fix/bound-doctor-workspace-memory-reads

Conversation

@cxbAsDev

@cxbAsDev cxbAsDev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

shouldSuggestMemorySystem and migrateLegacyRootMemoryFile in src/commands/doctor-workspace.ts read AGENTS.md, MEMORY.md, and archived memory.md with unbounded fs.promises.readFile(..., "utf-8"). A malicious or runaway workspace file could OOM the doctor repair path before any diagnosis or merge.

Why This Change Was Made

  • AGENTS.md is only scanned for a memory-system reference, so a 1 MiB cap is plenty.
  • Root memory files are markdown journals; 8 MiB is generous while preventing runaway files from OOMing migration.
  • Existing catch behavior is preserved: an oversized/unreadable AGENTS.md is treated as missing guidance, and an oversized or unreadable MEMORY.md/memory.md pair is left fully in place (no archive, no merge) with a skipped-repair note.

User Impact

  • openclaw doctor workspace memory checks no longer buffer arbitrarily large files.
  • Oversized AGENTS.md / memory files are handled gracefully instead of crashing.
  • Normal workspace doctor flows work exactly as before.

Evidence

  • Replaced unbounded fs.promises.readFile calls with readRegularFile capped reads in src/commands/doctor-workspace.ts.
  • Added regression tests in src/commands/doctor-workspace.test.ts covering an oversized AGENTS.md, oversized canonical/legacy memory files, and an unreadable canonical file.
  • Local test run:
    node scripts/run-vitest.mjs src/commands/doctor-workspace.test.ts --run
    # 9 tests passed
    

Real behavior proof

Exact-head run at 1a34dcabb0a386b5f2db5707a7c83c084b40fedf with a standalone driver (node --import tsx, Node v24.15.0) that imports the real helpers from src/commands/doctor-workspace.ts — the module openclaw doctor calls via src/commands/doctor-memory-search.ts — against isolated /tmp workspaces (HOME/OPENCLAW_STATE_DIR pointed at the fixture root; paths redacted as $PROOF). Each fixture went through migrateLegacyRootMemoryFile (structured result) and maybeRepairWorkspaceMemoryHealth (the openclaw doctor --fix repair entry, auto-approved prompter); note boxes trimmed to content lines:

(a) normal merge: small MEMORY.md + small memory.md
    migrateLegacyRootMemoryFile -> changed: true, removedLegacy: true, mergedLegacy: true,
      archivedLegacyPath: $PROOF/.../.openclaw-repair/root-memory/<ts>/memory.md, copiedBytes: 24
    doctor entry -> note "Workspace memory root merged:" (+ backup/merged/removed lines)
    after-state: MEMORY.md 350 bytes (legacy fact + merge marker present), memory.md removed, archive exists

(b) oversized canonical (8 MiB + 4 KiB) + normal legacy
    migrateLegacyRootMemoryFile -> changed: false, readLimitExceeded: true, readError: false
    doctor entry -> note "Workspace memory root repair skipped (a file exceeded the safe read limit):"
    after-state: both files untouched (canonical byte-identical), no .openclaw-repair created

(c) normal canonical + oversized legacy (8 MiB + 4 KiB)
    migrateLegacyRootMemoryFile -> changed: false, readLimitExceeded: true, readError: false
    doctor entry -> note "Workspace memory root repair skipped (a file exceeded the safe read limit):"
    after-state: both files untouched (canonical byte-identical), no .openclaw-repair created

(d) unreadable canonical (chmod 000) + normal legacy
    migrateLegacyRootMemoryFile -> changed: false, readLimitExceeded: false, readError: true
    doctor entry -> note "Workspace memory root repair skipped (a file could not be read):"
    after-state: both files untouched, no .openclaw-repair created

(bonus) AGENTS.md cap
    normal AGENTS.md referencing MEMORY.md -> shouldSuggestMemorySystem = false
    oversized AGENTS.md (2 MiB > 1 MiB cap) -> shouldSuggestMemorySystem = true

Interpretation:

  • Normal inputs merge exactly as before: legacy memory.md is archived under .openclaw-repair/root-memory/<ts>/ and its content is merged into MEMORY.md.
  • Rejection is mutation-free: an oversized canonical, an oversized legacy, or an unreadable file skips the repair with both files left in place — nothing is archived or removed. The doctor note distinguishes "exceeded the safe read limit" (readLimitExceeded) from other read failures (readError).
  • A 2 MiB AGENTS.md exceeds the 1 MiB cap and is treated as missing guidance.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S labels Jul 7, 2026
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 8:42 AM ET / 12:42 UTC.

Summary
The branch bounds AGENTS.md and root-memory reads in doctor workspace repair, adds safe no-mutation handling for rejected reads, and extends tests for race, archive, restoration, and symlink cases.

PR surface: Source +128, Tests +249. Total +377 across 2 files.

Reproducibility: yes. in source terms: the doctor workspace migration has concrete paths for oversized, unreadable, raced, and archive-failure root-memory inputs. The provided transcript demonstrates an older head, but not the full current-head race and atomic archive behavior.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-workspace.test.ts, migration/backfill/repair: src/commands/doctor-workspace.ts, serialized state: src/commands/doctor-workspace.test.ts, serialized state: src/commands/doctor-workspace.ts, unknown-data-model-change: src/commands/doctor-workspace.test.ts, unknown-data-model-change: src/commands/doctor-workspace.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🦐 gold shrimp
Patch quality: 🐚 platinum hermit
Result: blocked until stronger real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add a redacted exact-head terminal transcript for the later recovery branches, including archive failure and race handling.
  • Have the assigned area owner review the resulting current-head behavior proof.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body provides credible redacted terminal output for an earlier head, but it does not demonstrate the current head’s later archive-race, restoration, independent-archive, symlink, and atomic archive-failure behavior; add redacted exact-head terminal output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Merging without current-head behavior proof leaves upgrade-sensitive doctor repair semantics unverified for archive races and atomic archive failures; a failed repair must not lose or misplace an existing workspace memory.md.

Maintainer options:

  1. Prove the current migration contract (recommended)
    Add redacted exact-head terminal proof for the latest race and atomic-archive-failure paths, showing that failed repairs preserve the workspace source or a recoverable archive.
  2. Pause for owner review
    Keep the PR open if equivalent exact-head proof cannot be produced, because the remaining question concerns recovery behavior for existing workspace state.

Next step before merge

  • [P1] The remaining merge gate is contributor-provided current-head behavior proof and assigned-owner review, not a safe autonomous code repair.

Security
Cleared: The two-file doctor migration hardening diff does not introduce a concrete security or supply-chain concern; its security-relevant file-read limits require behavior proof rather than a separate security finding.

Review details

Best possible solution:

Keep the capped descriptor-backed reads and validate the complete current-head migration contract with a redacted terminal transcript covering normal merge, rejected reads, archive-race growth, restoration/atomic archive failure, and symlinked guidance before assigned-owner merge review.

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

Yes, in source terms: the doctor workspace migration has concrete paths for oversized, unreadable, raced, and archive-failure root-memory inputs. The provided transcript demonstrates an older head, but not the full current-head race and atomic archive behavior.

Is this the best way to solve the issue?

Yes in direction: bounded regular-file reads and validate-before-mutate behavior are the narrowest solution. The current head still needs real behavior evidence for its later recovery branches before it is the best proven merge candidate.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a bounded reliability and migration-safety fix for doctor behavior with limited but meaningful impact on existing workspaces.
  • merge-risk: 🚨 compatibility: The patch changes how existing MEMORY.md and legacy memory.md files are read, archived, restored, and retained during doctor repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The PR body provides credible redacted terminal output for an earlier head, but it does not demonstrate the current head’s later archive-race, restoration, independent-archive, symlink, and atomic archive-failure behavior; add redacted exact-head terminal output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +128, Tests +249. Total +377 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 147 19 +128
Tests 1 249 0 +249
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 396 19 +377

What I checked:

  • Current-head scope exceeds supplied proof: The supplied real-behavior transcript is for 1a34dcabb0a386b5f2db5707a7c83c084b40fedf, while the current PR head is e552c76d9a68a5b672f205fe94b3f5f6c2196555 and includes later commits for bounded-read races, restoration failure, independent archives, symlink guidance, and atomic archive failures. (e552c76d9a68)
  • Existing review continuity: The latest completed ClawSweeper review already identified missing proof for the then-current added archive-race, restoration, independent-archive, and symlink behavior; the newest head adds another atomic-archive-failure change without updated exact-head evidence. (99b8964ea5a4)
  • Likely ownership trail: The recent PR commits for migration-race preservation and atomic archive-failure reporting are authored by steipete, who is also assigned to the PR in the provided timeline. (src/commands/doctor-workspace.ts, e552c76d9a68)

Likely related people:

  • steipete: Authored the recent migration-race, restoration, archive, symlink, and atomic-failure commits on this PR and is assigned in the timeline. (role: recent area contributor and assigned reviewer; confidence: high; commits: 2cf47113e5fe, 1aac7b98335d, 65868fa5004a; files: src/commands/doctor-workspace.ts, src/commands/doctor-workspace.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (36 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-15T05:30:47.799Z sha baf3f93 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-16T03:34:58.822Z sha 1a34dca :: needs maintainer review before merge. :: none
  • reviewed 2026-07-18T11:01:43.864Z sha 2cf4711 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T11:39:46.024Z sha 1aac7b9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T11:58:52.955Z sha 65868fa :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T12:08:26.475Z sha 0fc9593 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T12:22:20.420Z sha 6cd2d9f :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T12:34:56.374Z sha 99b8964 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 7, 2026
@cxbAsDev
cxbAsDev force-pushed the fix/bound-doctor-workspace-memory-reads branch 3 times, most recently from 7980abb to d13a867 Compare July 7, 2026 09:28
@cxbAsDev

cxbAsDev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review\n\nI added real behavior proof to the PR body, including the local test command and output that exercises the oversized-file rejection path.

@cxbAsDev
cxbAsDev force-pushed the fix/bound-doctor-workspace-memory-reads branch from d13a867 to f486bc9 Compare July 7, 2026 09:58
@cxbAsDev

cxbAsDev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added real behavior proof that exercises the doctor workspace memory helpers (shouldSuggestMemorySystem and migrateLegacyRootMemoryFile) with normal and oversized inputs.

  • Normal AGENTS.md and split-brain MEMORY.md/memory.md pairs still work as before.
  • A 2 MiB AGENTS.md is treated as missing memory guidance (1 MiB cap).
  • A 9 MiB legacy memory.md is archived but not merged (8 MiB cap), returning archiveOnly: true.

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 Jul 7, 2026
@cxbAsDev
cxbAsDev force-pushed the fix/bound-doctor-workspace-memory-reads branch 5 times, most recently from b873ef4 to f476845 Compare July 11, 2026 16:38
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 11, 2026
@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased once more onto the latest upstream/main to pick up the experience-review format/import fixes (7ff41d82710, cd36a175e65).

New head: 890f00d5860.

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto the latest upstream/main to pick up fixes for unrelated CI failures:

  • 2e622491ebd style(codex): restore event projector formatting
  • aaf335af04c fix(deadcode): clean Knip child trees on parent signal

New head: 98b826bfed8.

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review - separated oversized-file rejection from other read failures and added regression tests for both diagnostics.

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review - rebased onto latest main to pick up unrelated CI/test fixes.

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review - rebased onto latest main to resolve the unrelated check-dependencies and check-lint drift.

@clawsweeper

clawsweeper Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review — branch is rebased onto latest upstream/main and fresh test proof is in.

CI=true pnpm test src/commands/doctor-workspace.test.ts

Result: 9/9 tests passed, including the oversized AGENTS.md and root-memory file regression cases.

Ready for review/land.

@clawsweeper

clawsweeper Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@cxbAsDev

Copy link
Copy Markdown
Contributor Author

Exact-head behavior proof at 1a34dcabb0a386b5f2db5707a7c83c084b40fedf (current PR head), replacing the stale archive-only transcript in the PR body. Current head semantics: oversized/unreadable inputs skip the repair with no mutation — no archiving, no merge; the old archiveOnly result field no longer exists.

Setup: Node v24.15.0, isolated HOME=/tmp/pr-101448-proof/home, OPENCLAW_STATE_DIR=/tmp/pr-101448-proof/state. The driver imports the real helpers from src/commands/doctor-workspace.ts — the module openclaw doctor uses (src/commands/doctor-memory-search.ts:337 calls maybeRepairWorkspaceMemoryHealth from it) — and runs each fixture through migrateLegacyRootMemoryFile (structured result) plus maybeRepairWorkspaceMemoryHealth (the openclaw doctor --fix repair entry, auto-approved prompter). Paths redacted: $PROOF=/tmp/pr-101448-proof. Note boxes trimmed to their content lines.

(a) Normal merge — small canonical + small legacy

migrateLegacyRootMemoryFile -> {
  "changed": true, "removedLegacy": true, "mergedLegacy": true,
  "archivedLegacyPath": "$PROOF/case-a-direct/workspace/.openclaw-repair/root-memory/<ts>/memory.md",
  "copiedBytes": 24
}
merged MEMORY.md contains legacy fact: true
merged MEMORY.md contains merge marker: true

maybeRepairWorkspaceMemoryHealth -> note "Workspace memory root merged:"
  - canonical: $PROOF/case-a-doctor/workspace/MEMORY.md
  - backup: $PROOF/case-a-doctor/workspace/.openclaw-repair/root-memory/<ts>/memory.md
  - merged legacy content from: $PROOF/case-a-doctor/workspace/memory.md
  - removed legacy file: $PROOF/case-a-doctor/workspace/memory.md
after-state: {"MEMORY.md":"350 bytes","memory.md":"missing",".openclaw-repair":"exists"}

(b) Oversized canonical (8 MiB + 4 KiB > 8 MiB cap) — rejected, no mutation

migrateLegacyRootMemoryFile -> {
  "changed": false, "removedLegacy": false, "mergedLegacy": false,
  "readLimitExceeded": true, "readError": false
}
maybeRepairWorkspaceMemoryHealth -> note "Workspace memory root repair skipped (a file exceeded the safe read limit):"
after-state: {"MEMORY.md":"8392704 bytes","memory.md":"24 bytes",".openclaw-repair":"absent"}
canonical byte-identical: true

(c) Oversized legacy (8 MiB + 4 KiB > 8 MiB cap) — rejected, no mutation

migrateLegacyRootMemoryFile -> {
  "changed": false, "removedLegacy": false, "mergedLegacy": false,
  "readLimitExceeded": true, "readError": false
}
maybeRepairWorkspaceMemoryHealth -> note "Workspace memory root repair skipped (a file exceeded the safe read limit):"
after-state: {"MEMORY.md":"30 bytes","memory.md":"8392704 bytes",".openclaw-repair":"absent"}
canonical byte-identical: true

(d) Unreadable canonical (chmod 000) — readError branch, no mutation

migrateLegacyRootMemoryFile -> {
  "changed": false, "removedLegacy": false, "mergedLegacy": false,
  "readLimitExceeded": false, "readError": true
}
maybeRepairWorkspaceMemoryHealth -> note "Workspace memory root repair skipped (a file could not be read):"
after-state: MEMORY.md present (mode 000, untouched), memory.md 24 bytes intact, .openclaw-repair absent

Bonus — the 1 MiB AGENTS.md cap in shouldSuggestMemorySystem:

normal AGENTS.md referencing MEMORY.md -> shouldSuggestMemorySystem = false
oversized AGENTS.md (2 MiB > 1 MiB cap) -> shouldSuggestMemorySystem = true

Regression tests at the same exact head:

$ node scripts/run-vitest.mjs src/commands/doctor-workspace.test.ts --run
 ✓ |commands| src/commands/doctor-workspace.test.ts (9 tests) 523ms
 Test Files  1 passed (1)
      Tests  9 passed (9)

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants