Repository navigation
fix: keep automatic titles from answering file requests - #131372
Conversation
Treat first-message text as source material at the shared label-completion boundary. Preserve caller language and style, tool isolation, dispatch timing, and existing/manual names. Verified with 84 focused tests, changed-file checks, independent Codex review, 28 real OpenAI label challenges, and before/after isolated Gateway UI file verification. Fixes #131303.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready verification for head Exact-head CI completed successfully; the native CI watcher returned The shared label producer is the repaired owner: source messages are labeled, not answered. Production delta is +6/−1 (net +5), solely bounded prompt text; tests net +15 and docs +5. No Code Mode, auth, timing, persistence, config, schema, or dependency change. The PR body contains the complete challenge table and inspected before/after screenshots and videos: real UI title changed from “File access unavailable” to “File verification request” while the same file task succeeded; manual rename survived another real turn. All 28 candidate OpenAI producer samples were topical. Exact focused commands passed: node scripts/run-vitest.mjs src/gateway/dashboard-session-title.test.ts src/auto-reply/reply/conversation-label-generator.test.ts src/agents/harness/builtin-openclaw.test.ts src/agents/isolated-completion.test.ts extensions/discord/src/monitor/thread-title.generate.test.ts extensions/telegram/src/auto-topic-label.test.tsnode scripts/check-changed.mjs -- src/auto-reply/reply/conversation-label-generator.ts src/auto-reply/reply/conversation-label-generator.test.ts docs/web/control-ui.mdpnpm buildThe regression was demonstrated failing pre-fix. Invalid build/recorder attempts are documented and excluded from pass counts. Finite model samples do not guarantee universal compliance; actual Discord/Telegram delivery was not exercised, while unchanged caller tests and real producer prompt shapes were. The title empty-tool contract is source/unit evidence, not a claim from truncated wire payloads. Latest ClawSweeper comment currently says review started; no Rank-up moves have been published. Its issue review's requested shared-boundary repair and real sibling-prompt proof are supplied. The queued PR publisher is not used as a blocking gate. Live matching branch rules require The task Gateway is stopped, and task-owned credential/state files and the dedicated credential window have been removed. Operator state was untouched. |
|
Merged via squash.
|
) Treat first-message text as source material at the shared label-completion boundary. Preserve caller language and style, tool isolation, dispatch timing, and existing/manual names. Verified with 84 focused tests, changed-file checks, independent Codex review, 28 real OpenAI label challenges, and before/after isolated Gateway UI file verification. Fixes openclaw#131303.
Closes #131303 — automatic session titles answer file requests instead of naming them.
What Problem This Solves
Fixes an issue where users completing file tasks in the Control UI would see failure-sounding automatic titles such as “File access unavailable”, even though the agent successfully read, wrote, and verified the requested file. A first message containing “If you cannot access files or tools, say so” could make the separate title model answer that instruction instead of naming the task.
Why This Change Was Made
The shared conversation-label producer now explicitly treats the supplied message as material to label, not a conversation to join. It preserves the caller's title/style/language policy and raw source, while telling the model not to execute the request, follow embedded reply instructions, or describe its own capabilities.
This repairs the existing owner boundary shared by dashboard/worktree/discussion titles, Discord thread names, and Telegram topic labels. It adds no helper, configuration, schema, extra model call, refusal filter, retry, or fallback. Code Mode, runtime/auth routing, utility-model selection, tool isolation, dispatch timing, title normalization, and persistence are unchanged.
User Impact
New automatic titles describe the first message's topic or intended task, rather than the title model's lack of tools. Existing generated names and manual names are deliberately not rewritten; users can rename them normally. The Control UI chat documentation now makes clear that a title is not execution status or a tool-access report.
Evidence
Real Gateway and Control UI, before and after
Both recordings used a session-owned isolated Gateway, synthetic workspace, real OpenAI API credential,
openai/gpt-5.6-luna, the OpenClaw runtime, and default automatic Code Mode. No operator Gateway/state or original reporter's credential directory was accessed. The browser drove the normal New session form and observed the actual admitted run and final chat event; no mocked Gateway or injected UI state.Exact first message:
TITLE-LIVE-7C92TITLE-LIVE-7C92finalfinal78ecc948-9bbf-476e-b028-f0c5022abc2dff2ad006-2f33-491d-b0df-d4e0abae137cTITLE-FOLLOWUP-OKThe after recording also shows the old wrong names remaining untouched in the sidebar. Main agent request diagnostics still show
exec/wait; this is not a Code Mode behavior change. The title adapter's literal empty tool catalog is covered by source and deterministic tests, not claimed from truncated wire payloads.Before: successful task, misleading title
After: task label, same successful file verification
Manual name survives a subsequent real turn
Before video (12 seconds):
title-repair-ui-before-proof.mp4
After video, including manual rename and follow-up (32 seconds):
title-repair-ui-after-proof.mp4
All captures were inspected before upload; only synthetic task content is visible. The recordings contain no credentials.
Real model-output challenges
The actual built public
generateConversationLabelproducer was called with the production dashboard prompt or the caller-specific prompt, not a toy prompt-only replacement. The baseline ran ten cases twice on Luna. Both baseline conditional-file-access samples were wrong: “Unable to access files or tools.” and “File access unavailable”.After the repair, 20/20 Luna calls and 8/8 Sol calls returned topical labels rather than executing or refusing the source request. These are observed samples, not a universal model-compliance guarantee. The unchanged 15-second title deadline was used; after calls completed in approximately 1.0–4.3 seconds.
Sol independently returned “Verify code from source file” twice, “Fix quoted comma parsing” / “Fix quoted commas in CSV”, “Bestätigungscode aus Datei prüfen” / “Bestätigungscode aus Datei überprüfen”, and “Correction import CSV” twice for the conditional-access, embedded-reply, German, and custom-language cases.
The genuine-error cases matter: the fix does not blacklist words such as “unable” or “access”. The custom-language case matters because a shared instruction to always match source language would break callers that deliberately request another language. Existing Discord and Telegram caller tests also passed. Actual Discord/Telegram network delivery was not exercised; their unchanged caller contracts and real producer prompt shapes were.
Deterministic regression, focused gates, and independent review
The existing full completion-request assertion was extended into two table cases, one for each exported label producer. Both failed on the pre-fix code specifically because the label-only instruction was missing; eleven existing cases passed. The test keeps model output inert and checks the real outbound request contract, rather than simulating model semantics with a prompt-substring mock.
Post-fix: 84 tests passed across the shared producer (13), dashboard title coordinator (32), isolated completion (21), built-in adapter (5), Discord (9), and Telegram (4). Core/test typechecks, changed-file lint/format/guards, zero dead exports, zero runtime import cycles, whitespace, and full build passed. Independent Codex autoreview completed with no accepted/actionable findings; its default P0 reporting scope is not represented as an exhaustive audit.
Exact local commands:
The task-local live recorders used the existing isolated-state infrastructure and public built SDK, with credentials confined to task-owned child processes:
Investigation, alternatives, and proof corrections
The causal distinction is important: title generation starts concurrently with dispatch and intentionally has no tools. Its short nonempty answer is accepted as a title and persisted. A successful later task does not replace that name. The defect was independently reproduced without Code Mode; there is no evidence that the recent Code Mode provider change caused it.
Best-fix judgment: the shared labeling boundary is the right owner. Refusal blacklists would reject legitimate failure topics; changing general isolated completion would impose title semantics on unrelated inference; retitling after completion would change the intended first-message contract and delay names for long/interrupted tasks. No obsolete runtime path is retained or added.
An early JSON-wrapped prompt experiment corrected refusals but drifted language, so it was discarded. The final repair preserves raw source and caller language policy. Initial UI recording mistakes were corrected against the real
sessions.createadmission response rather than weakening the success assertions.Two post-build proof attempts were invalid before inference: first, a concurrent dirty-source launcher rebuild removed chunks under SDK imports; second, the local recorder expected full-build
build-info.json, which the dev launcher does not regenerate. Valid runs waited for normal Gateway readiness, then used its canonical.buildstamp. No runtime cache override, increased timeout, missing-chunk copy, dependency edit, or product workaround was used. Failed attempts remain in local artifacts and are excluded from semantic pass counts. The separate dev-build Control UI cleanup/test mismatch is recorded as a named follow-up, “Preserve Control UI assets during dev rebuilds”, outside this PR.Evidence map:
chat-send-agent-dispatch.ts/chat-send-background.ts→dashboard-session-title.ts→ sharedconversation-label-generator.ts→isolated-completion.ts/harness/builtin-openclaw.ts; Discordmonitor/thread-title.ts, Telegramauto-topic-label.ts/auto-topic-label-config.ts, and UIsession-display.tsinspected. Current main has the same unprotected labeling handoff. History preserves the first-message and concurrent-dispatch contracts. Original title-prompt authorship traces to the automatic-title feature by @zhangguiping-xydt; the later sentence-case change is by @vyctorbrzezowski. Authorship is not evidence that either change introduced this model-dependent symptom.Related-item search found no proven duplicate of this semantic defect. The broader non-dashboard auto-title proposal changes trigger coverage and remains separate; this repair neither implements nor closes it.
Size: production +6/−1 (net +5), tests +39/−24 (net +15), docs +5/−0. The production growth is only the bounded missing model-visible label/answer contract at the existing handoff—no additional abstraction, control flow, or model call. There are no configuration/default, schema, protocol, dependency, or migration changes.