fix(skills): preserve compact prompt descriptions#88426
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 3:17 PM ET / 19:17 UTC. Summary PR surface: Source +52, Tests +24, Docs +3. Total +79 across 4 files. Reproducibility: yes. Current main source shows compact fallback omits all descriptions when full formatting exceeds the prompt budget, and the PR proof exercises the changed compact prompt path with live agent runs. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the maintainer rewrite after exact-head gates, preserving identity-first compact budgeting, UTF-16-safe description truncation, version-driven session refresh, and docs aligned with both compact modes. Do we have a high-confidence way to reproduce the issue? Yes. Current main source shows compact fallback omits all descriptions when full formatting exceeds the prompt budget, and the PR proof exercises the changed compact prompt path with live agent runs. Is this the best way to solve the issue? Yes. The PR fixes the existing skills prompt formatter and budget decision point, preserves identity-first compact behavior, reuses the existing prompt-format refresh mechanism, and leaves omitted-skill lookup policy to separate related work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8656c3b357f6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +52, Tests +24, Docs +3. Total +79 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
Review history (1 earlier review cycle)
|
|
The adaptive compact-description sizing is a nice idea. One tiny edge case to think about: |
|
@abel-zer0 thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
Co-authored-by: clawstation <[email protected]>
aa9b475 to
3bf7b99
Compare
|
Maintainer takeover is complete at exact head Best-fix review: the rewritten patch keeps current Proof:
Known proof gaps: none. The source head is frozen; failed earlier live attempts were assertion-harness calibration only, while every underlying real agent/provider turn completed successfully. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
Related: #50677
What Problem This Solves
When a skills catalog exceeded
maxSkillsPromptChars, OpenClaw's compact fallback removed every description. Opaque skill names then lost the semantic trigger guidance the model needs to choose the right skill.Why This Change Was Made
The compact formatter now preserves the existing name/location/version identity set first, then spends only the remaining prompt budget on bounded descriptions. Description truncation reuses the shared UTF-16-safe helper so a limit cannot split a surrogate pair, and the prompt-format version advances so persisted sessions rebuild the changed catalog shape.
This is a current-
mainrewrite of the original contribution: it keeps the newer version-marker/session-refresh behavior, accounts for the complete rendered notice when enforcing the cap, and avoids trading an identity for description text.User Impact
Large skills installations retain useful matching descriptions whenever budget remains. At the exact identity-only budget, behavior remains the previous compact contract: all identities fit, descriptions are omitted, and the prompt explains that state. Documentation now describes both compact modes.
Evidence
3bf7b9967330af23b8db52c175192442da3cf178.run_3ff6ad25c73e: 2 files, 31 tests passed (compact-formatand session snapshot coverage).run_1eeb815a2313: core/core-tests/docs lanes passed, including core and core-test tsgo, changed-file lint, import-cycle and repository guards.run_b4518917d9ec: two realopenclaw agent --localturns through the repository mock/v1/responsesendpoint. At 18,000 chars, 29 discovered identities/versions and all 12 long fixture descriptions survived with UTF-16-safe truncation. At the exact 6,107-char identity budget, the same 29 identities/versions remained byte-for-byte after description-line removal, with zero descriptions.git diff --checkpassed.AI-assisted maintainer takeover: an OpenClaw maintainer agent rebased and rewrote the contributor patch against current
main, added regression/live proof, and preserved contributor credit in the commit.