Skip to content

fix: correct tautological uppercase check in tool description summarizer#93753

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
GautamKumarOffical:fix/tautological-uppercase-check
Jun 16, 2026
Merged

fix: correct tautological uppercase check in tool description summarizer#93753
vincentkoc merged 1 commit into
openclaw:mainfrom
GautamKumarOffical:fix/tautological-uppercase-check

Conversation

@GautamKumarOffical

Copy link
Copy Markdown
Contributor

Summary

The isToolDocBlockStart function in src/agents/tool-description-summary.ts had a tautological condition that made it incorrectly classify mixed-case lines as doc block headings.

The bug: Line 43 checked normalized === normalized.toUpperCase(), but normalized was already set to line.trim().toUpperCase() on line 24, making this condition always true. This meant any line ending with : and longer than 12 characters would be treated as a doc block start — even if it wasn't all uppercase.

Example: A tool description containing a line like "My Custom Section Title:" would be incorrectly skipped during summarization, causing the tool's description to be truncated when it shouldn't be.

Fix

Changed the comparison from normalized === normalized.toUpperCase() to line.trim() === line.trim().toUpperCase() so it correctly checks whether the original line is all uppercase, matching the intent of the other explicit checks for known heading patterns like "ACTIONS:", "JOB SCHEMA:", etc.

Verification

  • The fix is a one-line change in src/agents/tool-description-summary.ts:43
  • Existing behavior for all-uppercase headings (e.g., "ACTIONS:", "CRITICAL CONSTRAINTS:") is preserved — these still match via the explicit checks on lines 29-38
  • Mixed-case lines like "My Custom Section Title:" no longer incorrectly match the fallback uppercase check

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. agents Agent runtime and tooling size: XS labels Jun 16, 2026
@clawsweeper

clawsweeper Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 16, 2026, 3:38 PM ET / 19:38 UTC.

Summary
The PR changes src/agents/tool-description-summary.ts so the fallback uppercase-heading check compares the original trimmed line instead of a value that was already uppercased.

PR surface: Source 0. Total 0 across 1 file.

Reproducibility: yes. from source inspection: a tool description whose candidate summary line is My Custom Section Title: exercises summarizeToolDescriptionText, and current main's fallback treats that mixed-case colon line as a doc-block start because it compares an already-uppercased value. I did not run a live command in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until 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 redacted terminal/live output from a real setup showing a mixed-case colon line is preserved in the tool summary path.
  • [P1] Add focused regression coverage for mixed-case colon headings and existing uppercase schema headings.

Proof guidance:

  • [P1] Needs real behavior proof before merge: No after-fix real setup output, screenshot, recording, terminal output, linked artifact, or redacted log is present. The contributor should add redacted proof and update the PR body so ClawSweeper re-reviews automatically; if it does not, a maintainer can comment @clawsweeper re-review.

Risk before merge

  • [P1] The patch has no contributor real behavior proof yet; the PR body only describes expected behavior.
  • [P1] No focused regression test covers mixed-case colon headings, so future drift is less guarded even though the code change itself is narrow.

Maintainer options:

  1. Decide the mitigation before merge
    Land the shared-helper predicate fix after the contributor adds redacted after-fix proof, with focused regression coverage for mixed-case colon headings and preserved uppercase schema headings.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The PR should wait for contributor real behavior proof; there is no narrow code repair for ClawSweeper to perform on their behalf.

Security
Cleared: The diff only changes local string classification in an agent display helper and does not touch dependencies, secrets, workflows, package metadata, or code execution paths.

Review details

Best possible solution:

Land the shared-helper predicate fix after the contributor adds redacted after-fix proof, with focused regression coverage for mixed-case colon headings and preserved uppercase schema headings.

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

Yes from source inspection: a tool description whose candidate summary line is My Custom Section Title: exercises summarizeToolDescriptionText, and current main's fallback treats that mixed-case colon line as a doc-block start because it compares an already-uppercased value. I did not run a live command in this read-only review.

Is this the best way to solve the issue?

Yes: fixing the shared isToolDocBlockStart predicate is the narrowest maintainable location because gateway catalog summaries, effective inventories, MCP inventories, and verbose /tools output all flow through this helper. The PR should still add real behavior proof, and a small regression test would be the safer landing shape.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a focused bug fix for agent tool summary output with limited blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No after-fix real setup output, screenshot, recording, terminal output, linked artifact, or redacted log is present. The contributor should add redacted proof and update the PR body so ClawSweeper re-reviews automatically; if it does not, a maintainer can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source 0. Total 0 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 1 0

What I checked:

Likely related people:

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.

@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 Jun 16, 2026
@vincentkoc vincentkoc self-assigned this Jun 16, 2026
The isToolDocBlockStart function checked normalized === normalized.toUpperCase()
but normalized is already uppercased from line 24, making the condition always true.
This caused mixed-case lines ending with ':' to be incorrectly detected as doc block
starts, truncating tool descriptions unnecessarily.

Compare the original line instead to correctly detect all-uppercase headings.
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer verification complete after rebasing onto current main.

  • focused inventory behavior: node scripts/run-vitest.mjs src/agents/tools-effective-inventory.test.ts (20 passed)
  • Testbox changed gate: tbx_01kv92dgfavkb6dvm70t14qdcm (passed)
  • fresh autoreview: clean, no accepted/actionable findings
  • git diff --check: passed

@vincentkoc
vincentkoc force-pushed the fix/tautological-uppercase-check branch from 1103b96 to 443c188 Compare June 16, 2026 20:41
@vincentkoc vincentkoc added the proof: override Maintainer override for the external PR real behavior proof gate. label Jun 16, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 16, 2026
@vincentkoc
vincentkoc merged commit 01d3812 into openclaw:main Jun 16, 2026
301 of 303 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 17, 2026
…zer (openclaw#93753)

The isToolDocBlockStart function checked normalized === normalized.toUpperCase()
but normalized is already uppercased from line 24, making the condition always true.
This caused mixed-case lines ending with ':' to be incorrectly detected as doc block
starts, truncating tool descriptions unnecessarily.

Compare the original line instead to correctly detect all-uppercase headings.

Co-authored-by: Gautam Kumar <[email protected]>
crh-code pushed a commit to crh-code/openclaw that referenced this pull request Jun 18, 2026
…zer (openclaw#93753)

The isToolDocBlockStart function checked normalized === normalized.toUpperCase()
but normalized is already uppercased from line 24, making the condition always true.
This caused mixed-case lines ending with ':' to be incorrectly detected as doc block
starts, truncating tool descriptions unnecessarily.

Compare the original line instead to correctly detect all-uppercase headings.

Co-authored-by: Gautam Kumar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: override Maintainer override for the external PR real behavior proof gate. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants