Skip to content

feat: teach models to use collapsible details where supported - #114706

Merged
steipete merged 4 commits into
mainfrom
steipete/details-prompt-capability
Jul 27, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/details-prompt-capability

Conversation

@steipete

@steipete steipete commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Models never learn that disclosure syntax exists, so collapsible details only appear when a user explicitly asks for them. Adding unconditional guidance would create a different problem: it would promise a rendering behavior on reply surfaces that flatten disclosures instead of rendering them natively.

Why This Change Was Made

The guidance is capability-gated so the system prompt can never contradict the delivery surface. One predicate feeds both the runtime capability declaration and the prompt section: Telegram rich accounts and the internal webchat/Control UI channel advertise markdownDetails, while other channels remain unchanged. The prompt section sits below the prompt-cache boundary, and nothing was added to hashStablePromptInput, preserving the stable prefix byte-for-byte across sessions.

User Impact

On Control UI and Telegram rich accounts, the model can now proactively tuck optional depth behind a disclosure while keeping the primary answer visible. Other channels keep their existing flattened output and receive no new guidance.

This is a release-note-worthy feature.

Evidence

  • Autoreview: clean (Codex GPT-5.6-sol, xhigh, commit mode).
  • Full changed gate: exit 0 across 35 lanes, run locally because the Blacksmith remote backend was unreachable.
  • Focused tests: system prompt 103 passed; runtime capabilities 4 passed; Telegram channel 24 passed.
  • Post-rebase focused rerun: system prompt 103 passed; Telegram channel 24 passed.
  • Prompt-cache contract: the capability-gated section is below the cache boundary; hashStablePromptInput is unchanged.
  • Red-main repair: removed an accidental duplicate Codex prewarm test route introduced by concurrent merges; test/scripts/test-projects.test.ts passes 220/220 and Codex autoreview reported no actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram agents Agent runtime and tooling labels Jul 27, 2026
@steipete
steipete marked this pull request as ready for review July 27, 2026 19:18
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 27, 2026
@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. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 3:53 PM ET / 19:53 UTC.

ClawSweeper review

What this changes

This PR teaches agents to use Markdown <details> disclosures for optional reply depth only when the active Telegram rich-message account or Control UI webchat advertises native support, and documents the resulting fallback behavior elsewhere.

Merge readiness

⛔ Blocked until real behavior proof is added - 4 items remain

Keep this PR open. The capability gate is narrowly scoped and no concrete patch defect surfaced, but this is a new model-behavior feature carrying a protected maintainer label and it still lacks after-fix evidence from a real Control UI or rich-message Telegram run. Likely related people: steipete (medium confidence; recent contributor to this implementation).

Priority: P3
Reviewed head: 925028137ed769593249c33c79feeaec22813131
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused tests are coherent, but the absent real supported-surface proof remains a merge gate for this user-visible feature.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR reports automated validation but does not show an after-fix run in Control UI or a rich-message Telegram account. Add a redacted recording, screenshot with visible result, terminal/live output, or runtime log; redact private endpoints, IP addresses, phone numbers, and credentials. Updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. 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.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports automated validation but does not show an after-fix run in Control UI or a rich-message Telegram account. Add a redacted recording, screenshot with visible result, terminal/live output, or runtime log; redact private endpoints, IP addresses, phone numbers, and credentials. Updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. 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 5 items Capability-gated implementation: The proposed Telegram channel capability adds markdownDetails only when the selected account has richMessages: true; the system prompt consumes that capability and omits the section for unsupported or minimal prompts.
Prompt-cache boundary coverage: The proposed prompt test asserts that the supported and unsupported prompt variants have the same cache-stable prefix, matching the implementation placement below the prompt-cache boundary.
Control UI capability path: The proposed runtime-capabilities change gives the internal webchat channel the same markdownDetails capability without adding a new configuration or persisted setting.
Findings None None.
Security None None.

How this fits together

Runtime channel capabilities flow into the agent system prompt before the model writes a reply. Telegram and the internal Control UI can advertise native disclosure support; the prompt should only encourage collapsible details on those surfaces so other channels retain their existing visible-content behavior.

flowchart LR
  A[Incoming channel and account] --> B[Runtime capability collection]
  B --> C{Details supported?}
  C -->|Yes| D[Agent system prompt guidance]
  C -->|No| E[Existing prompt behavior]
  D --> F[Model reply with optional details]
  F --> G[Telegram or Control UI rendering]
  E --> H[Other channel output]
Loading

Decision needed

Question Recommendation
Should OpenClaw proactively instruct models to use collapsible disclosures on supported Telegram and Control UI reply surfaces once live rendering proof confirms the behavior? Adopt after proof: Accept the capability-gated guidance after a real supported-surface run proves that generated details render correctly and do not hide required content.

Why: The patch is a new user-visible model-authoring behavior rather than a repair to an established contract; tests establish capability routing but do not settle whether this output style belongs in the default product guidance.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports automated validation but does not show an after-fix run in Control UI or a rich-message Telegram account. Add a redacted recording, screenshot with visible result, terminal/live output, or runtime log; redact private endpoints, IP addresses, phone numbers, and credentials. Updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. 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.
  • Resolve merge risk (P1) - Merging without real behavior proof leaves unverified whether an actual model follows the new guidance and whether Telegram rich-message rendering preserves the primary answer while collapsing only optional detail.
  • Resolve merge risk (P1) - The change deliberately introduces proactive model-output behavior on two reply surfaces, so a maintainer should explicitly confirm that this product direction is desired after the live rendering proof is available.
Agent review details

Security

None.

PR surface

Source +30, Tests +42, Docs +11. Total +83 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 3 40 10 +30
Tests 4 54 12 +42
Docs 3 13 2 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 107 24 +83

Review metrics

None.

Mantis proof suggestion

A short Telegram Desktop recording can directly demonstrate the changed rich-message behavior and whether the primary answer remains visible outside the disclosure. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify that a rich-message Telegram reply generated with this PR renders optional `<details>` content as a collapsible section while keeping the primary answer visible.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the capability gate, add redacted after-fix proof of a generated Control UI or rich-message Telegram response whose optional details collapse natively while the primary answer stays visible, then obtain maintainer confirmation for the proactive prompting behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the capability gate, add redacted after-fix proof of a generated Control UI or rich-message Telegram response whose optional details collapse natively while the primary answer stays visible, then obtain maintainer confirmation for the proactive prompting behavior.

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

Not applicable as a bug reproduction: the PR adds a new, capability-gated output behavior. The missing validation is after-fix proof on a real supported reply surface, not a failing current-main reproduction.

Is this the best way to solve the issue?

Unclear until a maintainer confirms the proactive prompting direction. The implementation is appropriately capability-gated and preserves the prompt-cache boundary, but real rendering proof is still needed to validate the intended user-facing result.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a narrowly scoped usability feature; unsupported channels retain existing output behavior and no current user regression is evidenced.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; 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: The PR reports automated validation but does not show an after-fix run in Control UI or a rich-message Telegram account. Add a redacted recording, screenshot with visible result, terminal/live output, or runtime log; redact private endpoints, IP addresses, phone numbers, and credentials. Updating the PR body should trigger a fresh review, or a maintainer can comment @clawsweeper re-review. 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.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The Telegram change is directly visible: a generated reply should render optional detail as a native collapsible section on a rich-message account.

Evidence

What I checked:

  • Capability-gated implementation: The proposed Telegram channel capability adds markdownDetails only when the selected account has richMessages: true; the system prompt consumes that capability and omits the section for unsupported or minimal prompts. (extensions/telegram/src/channel.ts:821, 925028137ed7)
  • Prompt-cache boundary coverage: The proposed prompt test asserts that the supported and unsupported prompt variants have the same cache-stable prefix, matching the implementation placement below the prompt-cache boundary. (src/agents/system-prompt.test.ts:1165, 925028137ed7)
  • Control UI capability path: The proposed runtime-capabilities change gives the internal webchat channel the same markdownDetails capability without adding a new configuration or persisted setting. (src/agents/runtime-capabilities.ts:46, 925028137ed7)
  • Proof gate remains unmet: The PR body reports tests and CI but contains no redacted after-fix runtime transcript, terminal output, recording, screenshot, or log showing an actual Control UI or rich-message Telegram reply rendering a collapsible section. The prior ClawSweeper review requested this proof, and the current labels still include status: 📣 needs proof. (925028137ed7)
  • Current branch provenance: The supplied PR history shows the current branch consists of the feature commit, a nullable account-id correction, generated docs-map refresh, and an unrelated duplicate Codex test-route removal; no merged replacement or current-main implementation was identified in the supplied context. (925028137ed7)

Likely related people:

  • steipete: Authored all four commits on the current PR head, including the Telegram capability gate, runtime prompt capability, system-prompt guidance, and follow-up correction. (role: recent area contributor; confidence: medium; commits: 41e986ba45dc, 603ca96f2917, fe0fc03e1170; files: extensions/telegram/src/channel.ts, src/agents/runtime-capabilities.ts, src/agents/system-prompt.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted after-fix evidence from a Control UI or rich-message Telegram run showing a generated collapsible-details reply.
  • Have a maintainer confirm that proactive disclosure guidance is the intended default behavior on supported surfaces.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-07-27T19:30:57.337Z sha fe0fc03 :: needs real behavior proof before merge. :: none

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper rank-up moves:

  • Skipped the requested live Control UI or rich-message Telegram capture for this landing lane. No approved credentialed supported-surface session is available here, and creating one would expand the validation scope beyond this prompt-guidance follow-up. Native <details> rendering and unsupported-channel flattening landed in feat: render model-authored collapsible details #114556; this PR changes the capability advertisement and model guidance. Exact-head CI, focused capability/prompt tests, and the cache-prefix assertion cover that new contract.
  • Applied the maintainer-decision move: adopt proactive disclosure guidance as the intended default behavior on surfaces that explicitly advertise markdownDetails. Unsupported surfaces must continue receiving no guidance and flattening disclosures visibly.

The first skip accepts the remaining absence of live generated-output proof; it is not being treated as if such proof exists.

@steipete
steipete merged commit 17e4222 into main Jul 27, 2026
124 checks passed
@steipete
steipete deleted the steipete/details-prompt-capability branch July 27, 2026 20:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 28, 2026
…aw#114706)

* feat: teach models to use collapsible details where supported

* fix: accept nullable accountId in telegram rich-messages helper

* docs: regenerate docs map for collapsible details heading

* fix(ci): remove duplicate Codex prewarm test route
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram docs Improvements or additions to documentation maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S 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.

1 participant