Skip to content

fix(skills): list omitted skill names when prompt is truncated#42637

Open
imwyvern wants to merge 4 commits into
openclaw:mainfrom
imwyvern:fix/skills-truncation-visibility
Open

fix(skills): list omitted skill names when prompt is truncated#42637
imwyvern wants to merge 4 commits into
openclaw:mainfrom
imwyvern:fix/skills-truncation-visibility

Conversation

@imwyvern

@imwyvern imwyvern commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Problem

When many skills are installed (e.g. 45+), the prompt truncation at maxSkillsPromptChars (default 30KB) silently drops skills near the end of the alphabetically-sorted list. The agent sees only a generic ⚠️ Skills truncated: included N of M message but has no way to discover which skills were omitted — it cannot use them even when directly relevant to the user's request.

Real-world example: a user sends a mp.weixin.qq.com link, but the wechat-reader skill (w-prefix, sorted last) is truncated out. The agent falls back to curl, which fails because WeChat articles are JS-rendered.

Solution

When skills are truncated, the note now includes the names of omitted skills (capped at 1KB to stay compact) and suggests openclaw skills info <name> or openclaw skills list so the agent can still discover and read them on demand.

Before:

⚠️ Skills truncated: included 40 of 45. Run `openclaw skills check` to audit.

After:

⚠️ Skills truncated: included 40 of 45. Run `openclaw skills check` to audit. Additional installed skills not expanded here: verify-on-browser, wechat-reader, web-search-plus, wrangler, video-frames. If a listed skill name becomes relevant, inspect it with `openclaw skills info <name>` or `openclaw skills list` before deciding whether to read its SKILL.md.

Changes

  • applySkillsPromptLimits() now returns omittedSkills alongside the existing fields
  • New formatTruncatedSkillNames() builds a compact name list (hard-capped at 1KB)
  • New buildSkillsTruncationNote() assembles the enriched truncation message
  • Two new test cases covering name listing for both char-based and count-based truncation

Tests

All 34 existing + new tests pass (npx vitest run src/agents/skills).

Real behavior proof

Behavior or issue addressed: Skills prompt truncation should keep the emitted prompt within maxSkillsPromptChars and advertise omitted skill identifiers that openclaw skills info <name> can resolve exactly, including raw keys with characters such as < and backticks.

Real environment tested: Local OpenClaw checkout on Darwin arm64, Node v22.22.2, pnpm 10.33.2, branch fix/skills-truncation-visibility, current HEAD db926508c4.

Exact steps or command run after this patch: Rendered 80 synthetic workspace skills through the real buildWorkspaceSkillsPrompt() code path with maxSkillsPromptChars: 520 and raw key skill-00<zeroraw; then parsed the emitted <omitted_skill_keys>payload and resolved the first advertised key throughformatSkillInfo()exact lookup. For comparison, the same rendering script was also run against local worktree commit79acf32` before the budgeted lookup-key note.

Evidence after fix: Terminal output copied from the local command run.

Before (79acf3289d):
{
  "commit": "before",
  "cap": 520,
  "length": 989,
  "hasOmittedSkillKeys": false,
  "advertisedCount": 0,
  "advertisedFirst": null,
  "hasRawKey": false
}
--- prompt excerpt ---
⚠️ Skills truncated: included 0 of 80 (compact format, descriptions omitted). Omitted: skill-00zeroraw, skill-01, skill-02, skill-03, skill-04, skill-05, skill-06, skill-07, skill-08, skill-09, skill-10, skill-11, skill-12, skill-13, skill-14, skill-15, skill-16, skill-17, skill-18, skill-19, skill-20, skill-21, skill-22, skill-23, skill-24, skill-25, skill-26, skill-27, skill-28, skill-29, skill-30, skill-31, skill-32, skill-33, skill-34, skill-35, skill-36, skill-37, skill-38, skill-39, skill-40, skill-41, skill-42, skill-43, skill-44, skill-45, skill-46, skill-47, skill-48, skill-49, skill-50, skill-51, skill-52, skill-53, skill-54, skill-55, skill-56, skill-57, skill-58, skill-59, skill-60, skill-61, skill-62, skill-63, skill-64, skill-65, skill-66, skill-67, skill-68, skill-69, skill-70, skill-71, skill-72, skill-73, skill-74, skill-75, skill-76, skill-77, skill-78, skill-79. Use `openclaw skills info <name>` to load them on demand. Run `openclaw skills check` to audit.

After (db926508c4):
{
  "commit": "after",
  "cap": 520,
  "length": 512,
  "hasOmittedSkillKeys": true,
  "advertisedCount": 21,
  "advertisedFirst": "skill-00<zero`raw",
  "hasRawKey": true,
  "exactLookupFirst": "skill-00<zero`raw"
}
--- prompt excerpt ---
⚠️ Skills truncated: included 0 of 80 (compact format, descriptions omitted). Omitted skill lookup keys for `openclaw skills info <name>` (JSON data; use exact string values): <omitted_skill_keys>["skill-00\u003czero`raw","skill-01","skill-02","skill-03","skill-04","skill-05","skill-06","skill-07","skill-08","skill-09","skill-10","skill-11","skill-12","skill-13","skill-14","skill-15","skill-16","skill-17","skill-18","skill-19","skill-20"]</omitted_skill_keys> (+59 more) Run `openclaw skills check` to audit.

Observed result after fix: The current prompt is 512 chars, below the 520 char cap, includes <omitted_skill_keys>, preserves the raw advertised key as JSON data, and formatSkillInfo() resolves the first advertised key exactly as skill-00<zeroraw`.

What was not tested: Live model submission was not needed for this prompt-rendering fix; the local proof covers the real prompt builder and CLI exact lookup formatter path.

Local script generated 80 workspace skills with maxSkillsPromptChars: 520, injected the raw omitted lookup key skill-00<zeroraw, and rendered the same prompt path through buildWorkspaceSkillsPrompt(). The after case also passes the first advertised key through formatSkillInfo()` exact lookup.

Before (79acf3289d, pre budgeted lookup-key note):

{
  "commit": "before",
  "cap": 520,
  "length": 989,
  "hasOmittedSkillKeys": false,
  "advertisedCount": 0,
  "advertisedFirst": null,
  "hasRawKey": false
}
--- prompt excerpt ---
⚠️ Skills truncated: included 0 of 80 (compact format, descriptions omitted). Omitted: skill-00zeroraw, skill-01, skill-02, skill-03, skill-04, skill-05, skill-06, skill-07, skill-08, skill-09, skill-10, skill-11, skill-12, skill-13, skill-14, skill-15, skill-16, skill-17, skill-18, skill-19, skill-20, skill-21, skill-22, skill-23, skill-24, skill-25, skill-26, skill-27, skill-28, skill-29, skill-30, skill-31, skill-32, skill-33, skill-34, skill-35, skill-36, skill-37, skill-38, skill-39, skill-40, skill-41, skill-42, skill-43, skill-44, skill-45, skill-46, skill-47, skill-48, skill-49, skill-50, skill-51, skill-52, skill-53, skill-54, skill-55, skill-56, skill-57, skill-58, skill-59, skill-60, skill-61, skill-62, skill-63, skill-64, skill-65, skill-66, skill-67, skill-68, skill-69, skill-70, skill-71, skill-72, skill-73, skill-74, skill-75, skill-76, skill-77, skill-78, skill-79. Use `openclaw skills info <name>` to load them on demand. Run `openclaw skills check` to audit.

After (db926508c4):

{
  "commit": "after",
  "cap": 520,
  "length": 512,
  "hasOmittedSkillKeys": true,
  "advertisedCount": 21,
  "advertisedFirst": "skill-00<zero`raw",
  "hasRawKey": true,
  "exactLookupFirst": "skill-00<zero`raw"
}
--- prompt excerpt ---
⚠️ Skills truncated: included 0 of 80 (compact format, descriptions omitted). Omitted skill lookup keys for `openclaw skills info <name>` (JSON data; use exact string values): <omitted_skill_keys>["skill-00\u003czero`raw","skill-01","skill-02","skill-03","skill-04","skill-05","skill-06","skill-07","skill-08","skill-09","skill-10","skill-11","skill-12","skill-13","skill-14","skill-15","skill-16","skill-17","skill-18","skill-19","skill-20"]</omitted_skill_keys> (+59 more) Run `openclaw skills check` to audit.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Mar 11, 2026
@greptile-apps

greptile-apps Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR enriches the skills truncation notice in applySkillsPromptLimits / resolveWorkspaceSkillPromptState so the agent is told the names of skills that were silently dropped due to the prompt-size budget. A new formatTruncatedSkillNames helper compactly lists omitted skill names (hard-capped at 1 KB via a pre-flight suffix check), and buildSkillsTruncationNote assembles the full enriched message together with guidance to run openclaw skills info <name> or openclaw skills list.

Key changes:

  • applySkillsPromptLimits now also returns omittedSkills — correctly computed as params.skills.slice(skillsForPrompt.length), which covers both count-based and char-based truncation paths.
  • formatTruncatedSkillNames uses a greedy prefix loop where the suffix (+N more) computed during each iteration exactly represents the final output if the loop stops there, guaranteeing the 1 KB cap is always respected.
  • Two new test cases cover name listing for char-budget truncation (existing test extended) and count-limit truncation (new test with a 3-skill workspace and maxSkillsInPrompt: 1).

Confidence Score: 5/5

  • This PR is safe to merge — it is a purely additive, well-tested change to the truncation notice with no impact on skill loading or prompt sizing logic.
  • The implementation is straightforward: the only new data flowing through the call chain is the list of already-computed omitted skills. The 1 KB cap guarantee is mathematically sound (the pre-flight suffix check ensures every accepted candidate string, including its trailing count, was already verified to fit before being committed). Tests cover both truncation modes. No existing behavior is altered.
  • No files require special attention.

Last reviewed commit: 4ca82d0

@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch 2 times, most recently from f39b8ad to 081fffe Compare March 18, 2026 12:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 081fffe8da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/skills/workspace.ts Outdated
@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch from 081fffe to 92fedef Compare March 20, 2026 04:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92fedef2c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/skills/workspace.ts Outdated
@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch from 92fedef to 5a272f2 Compare March 20, 2026 08:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a272f20ea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/skills/workspace.ts Outdated
@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch from 5a272f2 to 341f520 Compare March 22, 2026 12:50
@aisle-research-bot

aisle-research-bot Bot commented Mar 22, 2026

Copy link
Copy Markdown

🔒 Aisle Security Analysis

We found 1 potential security issue(s) in this PR:

# Severity Title
1 🔵 Low Prompt/markup injection via unsanitized remote node labels in skills prompt (remoteNote)
1. 🔵 Prompt/markup injection via unsanitized remote node labels in skills prompt (remoteNote)
Property Value
Severity Low
CWE CWE-74
Location src/agents/skills/workspace.ts:931-954

Description

remoteNote is injected verbatim into the skills prompt without escaping/sanitization.

  • remoteNote is taken from opts.eligibility.remote.note and only .trim() is applied.
  • remoteNote is then concatenated into the prompt via joinPromptSections(params.remoteNote, ...).
  • The note originates from getRemoteSkillEligibility() which builds it using remote node displayName values (labels.join(", ")). A paired/connected remote node can supply a displayName containing newlines, XML-like tags, or markdown that can:
    • break the structured <available_skills> prompt format
    • inject additional instructions into the LLM context

Vulnerable code (prompt concatenation):

const remoteNote = opts?.eligibility?.remote?.note?.trim();
...
prompt: joinPromptSections(params.remoteNote, note, skillsBody),

Upstream source (remote node metadata used to construct the note):

const labels = macNodes.map((node) => node.displayName ?? node.nodeId).filter(Boolean);
... `Remote macOS node available (${labels.join(", ")}). ...`

Recommendation

Treat remoteNote as untrusted text and escape or constrain it before inserting into the structured prompt.

Recommended approach: sanitize/escape and/or wrap it in a dedicated XML element with escaping.

Example:

function sanitizePromptNote(str: string): string {
  return str.replace(/[\x00-\x1f\x7f]/g, ""); // drop control chars/newlines/tabs
}

const remoteNote = sanitizePromptNote(opts?.eligibility?.remote?.note ?? "").trim();// If the prompt is XML-ish, escape:
const safeRemoteNote = remoteNote ? `<remote_note>${escapeXml(remoteNote)}</remote_note>` : "";

Also sanitize displayName when constructing the note in getRemoteSkillEligibility() (e.g., sanitizeSkillName() or stricter allowlist) to prevent newline/tag injection at the source.


Analyzed PR: #42637 at commit 42d1f55

Last updated on: 2026-04-28T16:27:41Z

@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch 2 times, most recently from b11d86e to 19fe7de Compare March 23, 2026 01:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19fe7de8b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/skills/workspace.ts Outdated
@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch from 19fe7de to 3464eb4 Compare March 23, 2026 02:06
@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: irc size: M and removed size: S labels Mar 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3464eb4b62

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/skills/workspace.ts Outdated
@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch from 3464eb4 to b49ca41 Compare March 23, 2026 02:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b49ca41477

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/skills/workspace.ts Outdated
@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch from b49ca41 to acd52c0 Compare March 28, 2026 09:38
@openclaw-barnacle openclaw-barnacle Bot removed channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: irc labels Mar 28, 2026
@clawsweeper

clawsweeper Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 5:05 PM ET / 21:05 UTC.

Summary
The PR adds JSON omitted-skill lookup keys to skills truncation notes and tests exact openclaw skills info <name> resolution under tight prompt caps.

PR surface: Source +192, Tests +186. Total +378 across 2 files.

Reproducibility: yes. Source inspection shows current main still emits only a count-based truncation note, and the PR head still has a tight-budget path where fixed-reserve candidate selection can over-truncate before the final notice is rendered.

Review metrics: 1 noteworthy metric.

  • Prompt Budget Contract: 1 existing limit behavior changed. The PR changes how maxSkillsPromptChars decides which skills remain in the agent prompt, so tight-budget behavior needs explicit review before merge.

Stored data model
Persistent data-model change detected: vector/embedding metadata: src/skills/loading/compact-format.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #50677
Summary: This PR is a candidate partial fix for the open skills truncation issue, while the merged compact-description PR solved an adjacent part of the same broad truncation problem.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦪 silver shellfish
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:

  • Budget compact candidate selection against the final rendered notice or exact equivalent accounting.
  • Refresh the branch against current main and preserve the compact-description prompt-format behavior from the merged skills rewrite.
  • Update the PR body with exact-head terminal or live output showing the cap and omitted-key lookup path, with private details redacted.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The PR body includes terminal proof, but it targets older head db926508c4; the current head needs exact-head terminal or live output with private details redacted. 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] Existing tight skills.limits.maxSkillsPromptChars or per-agent prompt-cap setups can hide more skills than necessary because the branch chooses compact candidates with a fixed reserve instead of the final rendered notice.
  • [P1] The skills catalog becomes agent/session context, so over-truncation can make an installed capability invisible for a run or refreshed snapshot.
  • [P1] The branch is conflicting with current main and must be refreshed without dropping the merged compact-description prompt-format behavior.
  • [P1] The PR body proof is terminal output for older head db926508c4; exact-head proof for 0ff24c7e1157e8d4da94463c10e90a772be11fea is still missing.

Maintainer options:

  1. Refresh And Fix Final-Notice Budgeting (recommended)
    Rebase onto current main, keep the compact-description format/version behavior, and compute retained candidates with the exact notice that will be emitted.
  2. Accept Conservative Truncation
    Maintainers could accept the fixed reserve, but tight-budget users may lose skills that would fit with the actual shortened notice.
  3. Pause For Broader Skills Truncation Work
    If omitted-key recovery should be redesigned with priority or pinning, leave this PR paused and continue in the canonical skills truncation issue.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Rebase or port this PR onto current main; preserve the compact-description prompt format/version behavior from src/skills/loading/workspace.ts; replace the fixed COMPACT_WARNING_OVERHEAD candidate budgeting with exact final rendered notice accounting; add/update focused tests for omitted lookup keys plus compact descriptions under tight maxSkillsPromptChars; keep validation scoped to the skills loading and CLI formatter tests.

Next step before merge

  • [P1] A narrow automated repair can port the useful omitted-key behavior onto current main and fix the exact-notice budgeting without a product decision.

Security
Cleared: The diff is limited to skills prompt rendering and tests, JSON-stringifies omitted keys, escapes tag-breaking characters, and does not change dependencies, workflows, lockfiles, or secret handling.

Review findings

  • [P1] Budget compact candidates with the final notice — src/skills/loading/workspace.ts:1388-1391
Review details

Best possible solution:

Refresh the branch against current main, preserve compact-description prompt formatting, budget retained candidates against the exact final rendered notice, and add exact-head proof for the cap and lookup-key path.

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

Yes. Source inspection shows current main still emits only a count-based truncation note, and the PR head still has a tight-budget path where fixed-reserve candidate selection can over-truncate before the final notice is rendered.

Is this the best way to solve the issue?

No. The JSON omitted-key recovery shape is reasonable, but this branch is not the best fix until it budgets against the final rendered notice and is refreshed against current main's compact-description prompt format.

Full review comments:

  • [P1] Budget compact candidates with the final notice — src/skills/loading/workspace.ts:1388-1391
    fitsCompact still chooses the retained skill prefix using a hard 150-character reserve, while the final renderer can shorten the truncation notice and fit more skills. Under tight maxSkillsPromptChars, this can discard skills that the emitted prompt had room to keep, so existing tight-budget setups still lose capabilities unnecessarily. This prior blocker remains present at the current head.
    Confidence: 0.92

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority skills prompt correctness fix affecting users with large skill catalogs or tight prompt budgets.
  • merge-risk: 🚨 compatibility: The PR changes how maxSkillsPromptChars decides retained skills and can over-truncate existing tight-budget configurations.
  • merge-risk: 🚨 session-state: The skills prompt is stored as agent/session context, so incorrect truncation can hide installed capabilities from a run.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • 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 includes terminal proof, but it targets older head db926508c4; the current head needs exact-head terminal or live output with private details redacted. 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 +192, Tests +186. Total +378 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 263 71 +192
Tests 1 192 6 +186
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 455 77 +378

Acceptance criteria:

  • [P1] pnpm test src/skills/loading/compact-format.test.ts src/skills/loading/skills.test.ts src/cli/skills-cli.test.ts.
  • [P1] pnpm check:changed -- .

What I checked:

  • Current main lacks omitted-key recovery: Current main still builds the truncated-skills note as only an included/total count plus openclaw skills check; it does not expose exact omitted lookup keys. (src/skills/loading/workspace.ts:1369, 129e2795ae11)
  • PR head uses fixed compact reserve: The PR head chooses compact candidates by subtracting a hard 150-character reserve before the final truncation note is rendered, so candidate selection can disagree with the final emitted prompt budget. (src/skills/loading/workspace.ts:1388, 0ff24c7e1157)
  • PR final notice is variable-length: The PR head can shorten or omit suffixes in buildTruncationNote, which confirms the fixed reserve and final rendered notice are not equivalent under tight caps. (src/skills/loading/workspace.ts:1455, 0ff24c7e1157)
  • Current main has newer compact-description behavior: Merged work on current main added compact description budgets and prompt-format behavior on the same skills prompt-limit surface, so this branch must be refreshed without regressing that behavior. (src/skills/loading/workspace.ts:1321, b47405954e1b)
  • PR status and proof state: Live PR metadata reports head 0ff24c7e1157e8d4da94463c10e90a772be11fea as CONFLICTING/DIRTY; the PR body proof still names older head db926508c4. (0ff24c7e1157)
  • Prior exact-head finding remains: The latest durable ClawSweeper review comment already raised the same Budget compact candidates with the final notice blocker for this head, and source inspection confirms it remains present. (src/skills/loading/workspace.ts:1388, 0ff24c7e1157)

Likely related people:

  • steipete: Merged the adjacent compact-description PR and appears as committer on earlier prompt-budget related history. (role: recent reviewer/merger; confidence: high; commits: b47405954e1b, 3bf7b9967330, 5b3873add41a; files: src/skills/loading/workspace.ts, src/skills/loading/compact-format.test.ts, docs/tools/skills.md)
  • abel-zer0: Authored the merged current-main compact-description rewrite that this PR now needs to preserve during refresh. (role: recent area contributor; confidence: high; commits: 3bf7b9967330, b47405954e1b; files: src/skills/loading/workspace.ts, src/skills/loading/compact-format.test.ts, docs/tools/skills.md)
  • koala73: Authored the earlier skills prompt bloat guard commit that introduced the prompt-cap behavior this PR changes. (role: introduced prompt-budget guard; confidence: medium; commits: 5b3873add41a; files: src/agents/skills/workspace.ts, src/config/types.skills.ts, src/config/zod-schema.ts)
  • Bartok Moltbot: Earlier work introduced alphabetic available-skills ordering, which determines which suffix skills are omitted under prefix truncation. (role: introduced deterministic prompt ordering; confidence: medium; commits: a4b94f77b918; files: src/agents/skills/workspace.ts, src/agents/skills/compact-format.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 (21 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-09T08:16:19.303Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice
  • reviewed 2026-07-09T08:35:57.328Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice
  • reviewed 2026-07-09T13:50:14.068Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice
  • reviewed 2026-07-09T17:49:30.871Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice
  • reviewed 2026-07-09T18:00:48.482Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice
  • reviewed 2026-07-09T18:09:12.766Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice
  • reviewed 2026-07-09T19:36:19.081Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice
  • reviewed 2026-07-09T20:22:18.649Z sha 0ff24c7 :: needs real behavior proof before merge. :: [P1] Budget compact candidates with the final notice

@imwyvern

imwyvern commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/main (HEAD 3646d37). Addressed Codex review:

  • Budgeted omitted-skill guidance inside maxSkillsPromptChars so the emitted prompt stays within the configured cap.
  • Advertised identifiers now use the exact lookup key that formatSkillInfo() resolves against, so openclaw skills info <name> is guaranteed to match.
  • Added regression test covering tight-cap + many-skills case.
  • CHANGELOG entry added.

Verification:

  • pnpm test src/agents/skills/compact-format.test.ts src/agents/skills.buildworkspaceskillsnapshot.test.ts src/cli/skills-cli.test.ts - PASS
  • pnpm exec oxfmt --check --threads=1 src/agents/skills/workspace.ts src/agents/skills/compact-format.test.ts src/agents/skills.buildworkspaceskillsnapshot.test.ts src/cli/skills-cli.test.ts CHANGELOG.md - PASS
  • pnpm exec tsc -p tsconfig.core.json --noEmit - PASS

Ready for another look.

@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 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3646d375b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/skills/workspace.ts Outdated
@imwyvern
imwyvern force-pushed the fix/skills-truncation-visibility branch from 3646d37 to db92650 Compare May 10, 2026 06:09
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 10, 2026
@imwyvern

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/main; current head is db926508c4.

  • Fixed the compact-format.test.ts TS2345 failure by replacing the ambiguous .map(makeEntry) callback usage with explicit single-argument callbacks.
  • Added structured ## Real behavior proof content to the PR body with before/after prompt output and exact formatSkillInfo() lookup evidence.
  • CI for db926508c4 is green: check, check-test-types, Real behavior proof, and the selected Critical Quality lane all pass.

Local validation:

  • pnpm test src/agents/skills — PASS
  • pnpm test src/cli/skills-cli.test.ts — PASS
  • pnpm exec oxfmt --check --threads=1 src/agents/skills/workspace.ts src/agents/skills/compact-format.test.ts src/agents/skills.buildworkspaceskillsnapshot.test.ts src/cli/skills-cli.test.ts CHANGELOG.md — PASS
  • pnpm exec tsc -p tsconfig.core.json --noEmit — PASS
  • pnpm check:changed --base upstream/main — PASS

@imwyvern

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/main; current head is 74883f7955.

  • Addressed the P2 review by retrying compact prompt rendering when remoteNote pushes the assembled full-format prompt over maxSkillsPromptChars, before dropping any skills.
  • Added a regression test covering a remote eligibility note with a near-budget full-format catalog; all skills remain visible in compact mode and no truncation count is emitted.
  • CI for 74883f7955 is green: check, check-test-types, Real behavior proof, and the selected Critical Quality lane pass.

Local validation:

  • pnpm test src/agents/skills — PASS
  • pnpm exec oxfmt --check --threads=1 src/agents/skills/workspace.ts src/agents/skills/compact-format.test.ts CHANGELOG.md — PASS

@clawsweeper

clawsweeper Bot commented May 20, 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.

@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

sakaenyeniceri5 and others added 4 commits June 18, 2026 09:24
When the skills prompt exceeds the configured budget and skills are
dropped, the truncation warning now lists the sanitized names of
omitted skills and guides the model to use `openclaw skills info <name>`
to load them on demand.

Skill names are sanitized (control chars, backticks, angle brackets
stripped) before inclusion in model-facing prompt text to prevent
prompt injection.
@vincentkoc

Copy link
Copy Markdown
Member

Clownfish 🐠 reef update

Thanks for the work here. Clownfish patched this branch directly so the contributor trail stays right where it started.

Source PR: #42637
Validation: pnpm test src/skills/loading/compact-format.test.ts src/skills/loading/skills.test.ts src/cli/skills-cli.test.ts; pnpm check:changed
This keeps attribution in the original current: commits, review context, and changelog notes all stay visible.

fish notes: model gpt-5.5, reasoning medium; reviewed against 0ff24c7.

@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@imwyvern 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.

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

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L 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.

3 participants