8 Commits
Author SHA1 Message Date
mysoul12138 fae5ada40d fix: Artifacts tab cannot open files when messages carry structured tool metadata
Two bugs prevented clicking Artifacts entries from opening files:

1. collectSessionArtifacts() only read S.toolCalls, but
   _syncToolCallsForLoadedMessages clears it when messages carry
   their own tool_calls/tool_use metadata. Fix: also scan messages'
   structured tool data (OpenAI tool_calls array + Anthropic
   tool_use content blocks).

2. openArtifactPath() only stripped ~/ and ./ prefixes. When artifact
   paths were absolute (e.g. /mnt/.../workspace/file.js), /api/list
   received the full absolute path and returned 404. Fix: strip the
   session workspace prefix before calling _workspacePathExists.

Bonus: renderSessionArtifacts() now displays workspace-relative paths
instead of cluttered absolute paths in the artifact list.
2026-06-01 17:19:48 +00:00
mysoul12138 f9ff6df883 fix: prevent browser autofill on clarify input (#clarify-autofill)
Chrome's password manager aggressively autofills the clarify card's
input field with saved credentials (e.g. provider base URLs) despite
autocomplete='off'. This causes two bugs:

1. 'Clarification closed. Your draft was kept in the composer.' appears
   on every session completion because _stashClarifyDraft reads the
   autofilled value and treats it as a user draft.

2. The autofilled URL gets injected into the main composer, confusing
   the user.

Fix: add readonly attribute to the clarify input element so Chrome's
autofill ignores it. When showClarifyCard() makes the card visible,
readonly is removed programmatically so the user can type normally.

Both the static HTML (index.html) and the dynamic DOM creation
(_ensureClarifyCardDom in messages.js) are patched.
2026-05-31 13:54:02 +08:00
mysoul12138 71e6eabb29 fix: let cron sessions bypass CLI_VISIBLE_SESSION_LIMIT for project chips (#3172)
When state.db has many non-cron sessions, the normal sidebar query caps
at CLI_VISIBLE_SESSION_LIMIT (20) rows ordered by latest activity. Older
cron runs get squeezed out before _include_project_hidden_background_sidebar_sessions
can rescue them, making them invisible under their project chip.

Add a second-pass cron-only query with a higher cap (CRON_PROJECT_CHIP_LIMIT=200)
that merges into the CLI session list.  The project-chip rescue layer then
marks them default_hidden so they stay addressable without polluting the
default sidebar window.

Verification: regression test seeds 25+ newer non-cron sessions and asserts
the older messageful cron session still appears with project_id set.
2026-05-30 23:25:41 +08:00
mysoul12138 1a991041f1 fix: use getModelLabel() in _formatSessionModelWithGateway fallback
When gateway_routing is absent, _formatGatewayModelLabel returns '' and
the fallback path returns raw s.model — which may contain an @provider:
prefix (e.g. @token-plan-cn.xiaomimimo.com:mimo-v2.5-pro).

getModelLabel() already handles stripping @provider: prefixes (ui.js:2855)
but was never called in this fallback path. Route through it so the
session list always displays a clean model name.

Closes #3172
2026-05-30 15:13:03 +08:00
mysoul12138andClaude Opus 4.7 5b3771012a Fix tool card duplication: skip detail when snippet equals preview
When tc.snippet === tc.preview (common for no-progress tools where
both are set to the same result_snippet), the detail block would show
identical content as the header. Skip the detail block in this case.

This also handles the reload-path where derived entries get snippet
populated but no preview, so displaySnippet falls back to the snippet
content for the header — same deduplication applies.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 00:20:49 +00:00
mysoul12138andClaude Opus 4.7 0002cda23d fix: stale unread dot, compression timer leak, tool card duplication (#3020, #2973)
#3020: Sync viewed-count in the polling path for actively-viewed sessions
so navigating away doesn't show a stale unread dot. Defensive clear of
completion-unread marker in _setSessionViewedCount.

#2973: Clear elapsed-timer attributes and interval when a live compression
card transitions from running to done, preventing the orphan timer from
overwriting the completed card state. Guarded by active-session check.

Tool card duplication: Route tool_complete result to tc.snippet (detail)
instead of tc.preview (header) to prevent identical content appearing in
both the card header and expanded detail section.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-30 00:20:49 +00:00
mysoul12138andClaude Opus 4.7 7f63a1ce71 Add regression test for JS/Python snippet limit parity
Prevents the JS slice(0,N) and Python _TOOL_RESULT_SNIPPET_MAX from
drifting apart again.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 16:12:05 +08:00
mysoul12138andClaude Opus 4.7 b476126cb9 fix(ui): match tool result snippet limit to backend (200 -> 4000 chars)
_cliToolResultSnippet truncated to 200 chars while the backend's
_tool_result_snippet uses 4000. This caused tool card details to be
more aggressively truncated after session reload than during live
streaming.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 12:34:10 +08:00