982 Commits

Author SHA1 Message Date
zhukunpenglinyutong 3ccd8bbc01 docs(changelog): add v0.5.4 release notes
Document features, improvements, and fixes for the 0.5.4 release in both CHANGELOG.md and the in-app changelog data.
2026-08-26 15:28:46 +08:00
zhukunpenglinyutong ff903af144 fix(input): delay model-config submenu hover to keep fly-outs reachable
The model list sits above Preset/Effort, so the pointer used to steal the
submenu while crossing those rows. First open stays immediate; switching
waits 200ms and is cancelled if the pointer reaches the already-open fly-out.
2026-08-26 15:17:41 +08:00
zhukunpenglinyutong 664f2148a3 fix: restore Codex rollout history and polish DSH settings UI
Index Codex 0.148+ sessions whose user prompt is a response_item,
and keep provider authJson inline instead of PasswordSafe.

Group DSH CLI install and local host as one product card. Portal
alert dialogs to body so confirm stays clickable, and skip phantom
scrollbars on submenus that already fit.
2026-08-26 13:39:03 +08:00
zhukunpenglinyutong c47bc3cb38 feat(input): nest model settings into a compact dropdown
Merge model, effort, speed, and 1M context into one summary trigger
with fly-out submenus that stay inside the plugin viewport. Compact
mode labels on the toolbar and add a short enter animation.
2026-08-26 12:07:23 +08:00
zhukunpenglinyutong 655398dc53 fix(zai): plan-usage review follow-ups
- Reuse the caller's long-lived CodemossSettingsService instead of
  rebuilding the whole manager graph on every webview poll
- Align z.ai cache TTL (115s) with the 120s webview poll cadence so
  back-to-back polls dedupe onto one probe
- Extract a ZaiTransport seam and add the tests the original PR body
  claimed: Bearer token/URL derivation, TTL enforcement, stale fallback,
  API-key fallback, and cache keyed by url+token (account switches no
  longer serve the previous account's quota)
- Merge duplicate period windows (TOKENS_LIMIT + CREDIT_LIMIT both
  mapping to 5h), keeping the worse usage pct
- Cap stale-cache fallback at 30 minutes and surface the stale flag in
  the tooltip as a data-may-be-outdated hint
- Allow plain-HTTP monitor probes only for loopback hosts so Bearer
  tokens never travel plaintext to a remote host
- Show the plan tier as the first tooltip line
2026-08-24 21:40:52 +08:00
朱昆鹏 6b9bca80cf Merge pull request #1709 from toxeh/feat/zai-glm-usage
feat(zai): GLM usage plan bar via monitor endpoint
2026-08-24 21:25:46 +08:00
zhukunpenglinyutong 667846e251 fix(input): file-reference bridge follow-ups
- keep legacy non-absolute bridge payloads as plain text instead of
  silently dropping them
- only absolute-path-looking @ markers disable the manual single-path
  fallback, so emails and annotations no longer block it
- share one Gson instance and request browser focus on the EDT in
  addFileReferences
2026-08-24 19:48:33 +08:00
he_dai_xiang 7d816f6522 fix(input): preserve text between external file references 2026-08-24 17:23:45 +08:00
toxeh b0488e2e02 feat(zai): GLM usage plan bar via monitor endpoint
Add z.ai/GLM proxy support to Claude plan-usage indicator.

Backend (Java):
- ClaudePlanUsageService: detect z.ai via ANTHROPIC_BASE_URL host check
- Probe {origin}/api/monitor/usage/quota/limit with Bearer token (60s TTL cache)
- Parse TOKENS_LIMIT (5h) + CREDIT_LIMIT (7d) + TIME_LIMIT (monthly MCP)
- Extract level field (plan tier) for tooltip; fallback to rate_limit cache

Frontend (TypeScript):
- planUsagePace: add workerId/level to PlanUsageSnapshot
- Rename GeminiQuotaFamily → QuotaFamily (neutral naming)
- PlanUsageIndicator: show workerId and tier in tooltip

Tests:
- ClaudePlanUsageServiceTest: 69 lines of z.ai-specific tests
- All pass: tsc clean, vitest 1337, gradle SUCCESS

Base: upstream/feature/v0.5.4
2026-08-22 07:31:35 -04:00
zhukunpenglinyutong db9874a4be fix(webview): route docs links to system browser via open_browser bridge
JCEF does not route target=_blank anchors to the system browser, so
clicking docs links in the CLI install dialog, MCP help dialog, and
MCP marketplace details did nothing. Intercept the clicks and send
them through the existing openBrowser bridge instead.
2026-08-22 18:47:06 +08:00
anlter a6ad024ab0 test(dsh): complete preset persistence fixture 2026-08-22 15:52:18 +08:00
anlter 4fb3d3c98e feat(dsh): add agent preset switching
- add a DSH preset selector with built-in and user-installed presets\n- persist the selected preset per tab and pass it through the session bridge\n- apply preset compositions to spawned headless DSH hosts with reload support
2026-08-22 15:43:52 +08:00
zhukunpenglinyutong 349bf3a767 fix(webview): share path-segment rule to stop truncating @file refs with spaced filenames
Extract looksLikePathSegment into webview/src/utils/pathSegment.ts so the
display-side scanner (CollapsibleTextBlock) and the input-side fallback
scanner (useFileTags) share one rule: a word after a space continues the
path when it contains a path separator or ends with a file extension,
with any trailing #L line marker stripped first.

PR #1576 applied this rule only to message display; the chat input box
still truncated absolute paths whose filenames contain spaces (e.g.
"第六章 框架开发实践.md"), and its comment promised extension support the
code did not have. Reuse the shared helper there, sync the comments, and
move the misplaced convertAtFileRefsToLinks docstring back to its
function.

Tests: new pathSegment.test.ts unit tests; useFileTags.test.ts gains
fallback cases for spaced absolute paths with and without line markers.
2026-08-22 13:50:22 +08:00
朱昆鹏 254c9421b3 Merge pull request #1576 from Cyber0xFE/feature/file-reference-display
修复 @file 引用在含空格文件名下的路径截断,并优化引用链接的展示样式
2026-08-22 13:42:38 +08:00
朱昆鹏 56de1791ab Merge pull request #1713 from toxeh/fix/model-select-provider-isolation
fix(model-select): provider-isolate label and icon resolution
2026-08-22 01:35:09 +08:00
zhukunpenglinyutong e2e86558b6 fix(codex): keep transient subagent status failures retryable
- Treat transient IO/metadata read failures as pending instead of
  terminal error in CodexSubagentHistoryLoader, and fix a latent NPE
  for agentId-only status requests
- Gate terminal error on success === true in history merge and subagent
  status mapping so later snapshots can correct transient errors
- Validate requestId against the latest sent poll request before merging
  status batches
- Show non-Codex (Claude) lookup errors again while keeping Codex
  pending noise hidden
- Restore narrow start-of-output error detection for apply_patch results
- Cache Codex session scans for 2s to avoid double full-tree walks
  per poll
- Reject ".." segments in agentPath validation
2026-08-22 01:29:36 +08:00
toxeh e7bb13a4ec fix(model-select): provider-isolate label and icon resolution
The Claude model mapping (MODEL_ID_TO_MAPPING_KEY / DEFAULT_MODEL_MAP /
MODEL_LABEL_KEYS, fed by the claude model-mapping setting) is keyed by
claude-* ids. Third-party catalogs — agy and the CLI providers — expose
models whose ids collide with those slots (e.g. claude-sonnet-4-6), so
the dropdown relabeled and re-iconed foreign catalog entries with the
user's Claude mapping.

Guard both lookups with currentProvider === 'claude': non-claude
providers now render catalog labels verbatim and resolve icons from the
raw model id.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 13:22:49 -04:00
朱昆鹏 d3c1b9bd15 Merge pull request #1566 from GGMGG/fix/codex-subagent-plan-v05
fix(codex): restore subagent lifecycle and plan rendering
2026-08-22 01:07:58 +08:00
朱昆鹏 92359c2716 Merge pull request #1565 from GGMGG/fix/codex-provider-activation-v05
fix(codex): preserve provider credentials and global config access
2026-08-22 00:36:34 +08:00
zhukunpenglinyutong 91299c509b Merge branch 'feature/v0.5.4' into feature/omp
Resolve conflicts with the DSH provider that landed on the base branch
after this PR was opened. Both providers now coexist:

- provider registries, CLI detection, and settings list omp + dsh
- mode/model state hooks and persistence handle both provider slices
- ModeSelect keeps the omp role-mode branch; dsh joins the headless
  CLI filter branch
- i18n (en/zh/zh-TW) carries both tool entries

Verified: webview vitest 1366/1366, ai-bridge node --test (532 pass,
same 19 pre-existing local-env failures as base), gradle compile +
targeted unit tests, tsc --noEmit.
2026-08-21 23:34:33 +08:00
朱昆鹏 35b5f705b9 Merge pull request #1664 from GGMGG/feat/codex-pet-actions-v05
feat(codex-pet): improve action controls and settings workspace
2026-08-21 22:17:39 +08:00
朱昆鹏 2df1ad4835 Merge pull request #1692 from toxeh/feat/claude-plan-usage
feat(claude): plan usage bar via SDK rate_limit_event
2026-08-21 21:12:53 +08:00
朱昆鹏 2bbdae8e20 Merge pull request #1705 from hebulin/fix/1700-selection-insert-content-loss
fix(input): preserve existing content when inserting external snippets with a stale selection
2026-08-21 21:03:27 +08:00
zhukunpenglinyutong 96924673c1 fix(settings): nest DSH connection card under the DeepSeek Harness row
Move the host connection card from above the CLI list so it sits with
the DSH install row, extract CliToolCard, and cover the new order in
tests.
2026-08-21 20:47:17 +08:00
zhukunpenglinyutong 157ab8f6aa docs: add v0.5.3 changelog and generalize history empty-state copy
Keep the Claude foreign-turn idle backstop timer referenced so silent
turns and node:test do not drain the event loop before executeTurn
settles.
2026-08-21 20:28:32 +08:00
朱昆鹏 0efa4fe5cc Merge pull request #1703 from hebulin/fix/1702-codex-untrusted-approval-policy
fix(codex): stop passing retired approval_policy=untrusted to Codex CLI
2026-08-21 19:48:35 +08:00
zhukunpenglinyutong e8d6fdc250 fix: address PR #1688 review findings across dsh, claude, grok and webview
- drain dsh bridge subprocess stderr so commands no longer pseudo-timeout
  (DshHostHandler, DshHistoryReader), with stderr tail in error payloads
- validate dsh host/bin settings before persisting; atomic settings write;
  guard start/stop lifecycle re-entry; name bridge reader threads
- split oversized sendMessage/foldHistoryEvents/runDshCommand into focused
  helpers (behavior-preserving)
- clear mux-open and bridge-drain race timers so finished turns release the
  node process promptly
- best-effort rejected/empty respond when approval or question bridging
  fails, so the dsh host never waits for the 15min watchdog
- idle backstop for turns whose own result was skipped as foreign
- grok: count only evidence-backed edits as successful on the error path;
  seq-based permission ledger keys; narrow isPermissionMethod to exact ACP
  permission methods
- ws-client: cap aggregate fragmented message size and fail on protocol
  violations (orphan continuation, data frame mid-fragment)
- tighten dsh host pid-reuse guard to bin path/basename or token match
- opencode models redirect via mkdtemp private directory (CWE-377)
- conversation-chain: always return an array; skip sidechain rows when
  backfilling parentUuid
- collect open editor files on the EDT; unify retired-model id trim
- webview: keep useFileChanges memo pure (enrichment moved to an effect with
  equality bail-out); 24h TTL for the file touch registry; disable the dsh
  auto-start checkbox until the first status arrives
- add 40+ tests covering the new behavior
2026-08-21 19:26:48 +08:00
hebulin 85ef43b7ff fix(input): preserve existing content when inserting external snippets with a stale selection
When the user had previously selected text inside the chat input box and then
triggered an IDE action (Add Selection / Add File to CC GUI), the webview's
stale non-collapsed selection was still anchored in the editable. The caret
insertion path ran range.deleteContents() on that stale range, silently
deleting all the text the user had already typed (#1700).

External content (code snippets, file paths, quote chips) arrives from IDE
actions, never from typing inside the box, so a non-collapsed range is never
a meaningful insertion point. Guard all three Java-interop insertion paths:

- tryInsertExternalSnippetAtCaret (insertCodeSnippetAtCursor)
- insertSingleFilePath (handleFilePathFromJava)
- addQuotedSnippet

Now only a collapsed caret inserts at position; a stale non-collapsed
selection falls back to appending at the end, preserving existing content.

Adds regression tests reproducing the select-all stale-selection scenario
for both snippet and file-path paths.

Closes #1700
2026-08-21 17:07:57 +08:00
hebulin a3f67fd90c fix(codex): stop passing retired approval_policy=untrusted to Codex CLI
Codex CLI v0.149.0 removed the 'untrusted' approval policy - its
ask-before-run semantics were merged into 'on-request'. The plugin
still mapped default/plan/sandbox permission modes to
approval_policy=untrusted, so every message failed with:
  Error: approval_policy = "untrusted" is no longer supported;
  remove this setting
and Codex became completely unusable after upgrading the CLI
(v0.146.0 -> v0.149.0) (#1702).

- permission-mapper.js: SANDBOX / DEFAULT now map to on-request
- CodexSDKBridge.java: plan / default env override now injects
  on-request instead of untrusted
- codex-utils.js: drop 'untrusted' from VALID_APPROVAL_POLICIES so
  stale env values are ignored instead of forwarded
- i18n: update codexModes.default.tooltip in all 10 locales

'on-request' is supported by both old and new CLI versions, so this
is safe for all users.
2026-08-21 14:48:44 +08:00
zhukunpenglinyutong 043a255772 feat: add DSH (DeepSeek Harness) CLI provider support
- ai-bridge: add dsh-channel and dsh services (host, session, events, ws-client,
  message-service, models-service, history-service, supervisor) with tests
- Java: add DshHostHandler, DshCliBridge, DshEnvSupport, DshHistoryReader;
  wire DSH into session routing, model handling and history services
- webview: add DshConnectionCard settings UI, useDshProvider hook,
  provider/model selectors and i18n entries for DSH
2026-08-18 23:40:51 +08:00
toxeh 06b19e7428 fix(claude): hide plan-usage bar until the first rate_limit_event arrives
API-key and proxy backends never emit rate_limit_event, so the first
polls answer 'unavailable' — the hook now stays idle (bar hidden)
instead of showing a permanent Usage dash. Once real data arrives the
indicator behaves as before, keeping the last data while re-polling.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-18 08:25:44 -04:00
toxeh a39c1f351b feat(claude): plan usage bar via SDK rate_limit_event
Surfaces Claude subscription rate-limit usage (utilization % + reset) in
the ContextBar using the plan-usage indicator from the previous commit.

- Java: ClaudePlanUsageService caches rate_limit_info from the SDK stream
  (utilization→capacity_pct, resetsAt→reset_at, 5h/7d window by reset
  delta); TTL-fresh snapshot served to the webview poll.
- Java: ClaudeMessageHandler adds a rate_limit_event case → cache.
- Java: ClaudePlanUsageHandler bridges get_claude_plan_usage polls →
  window.updateClaudePlanUsage (registered in ChatWindowDelegate).
- Webview: useClaudePlanUsage poll hook (120s) + ContextBar renders the
  indicator for the claude provider.
- ClaudePlanUsageServiceTest: rate_limit_event parsing + cache behavior.

Note: rate_limit_event only fires on real Anthropic (OAuth subscription)
backends; on proxies it never arrives, so the bar stays hidden.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-18 07:17:09 -04:00
toxeh f6f4206846 feat(webview): plan-usage indicator component + pace utils
Adds the provider-agnostic plan-usage UI for the chat input ContextBar:

- planUsagePace.ts: pace coloring (TP = usage %, TT = linear time budget
  through the reset window), capacity payload normalization into a
  PlanUsageSnapshot, window resolution/switching (5h/7d) with persisted
  selection, and reset formatting (short bar label without trailing
  period + full tooltip datetime).
- PlanUsageIndicator.tsx: mini bar + % + window chip + short reset +
  worst-window dot; tooltip lists all windows and reset times.
- context-bar.css: .plan-usage* styles (green/yellow/red pace colors).
- Unit tests for the pace utils and the indicator.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-18 07:17:09 -04:00
zhukunpenglinyutong 2e29100591 feat: add official docs entry and fix dashboard popover theming
- ConfigSelect: add localized Official Docs link opening docs.mossx.ai
- tokentracker-dashboard: portal Base UI overlays into .tt-dashboard
  scope so popovers keep scoped preflight/CSS vars/dark variant
- DateRangePopover: add Clear button for selected range
- test: poll for turnSink registration in persistent-query-service test
2026-08-18 15:30:05 +08:00
朱昆鹏 5b74e5331a Merge pull request #1660 from gadfly3173/fix/claude-interrupt-marker-and-closed-runtime
fix(claude): stabilize rewinds, diagnostics, and long sessions
2026-08-18 14:28:49 +08:00
朱昆鹏 e294a3281e Merge pull request #1663 from hebulin/fix/1661-slash-command-with-input
fix(chat): allow slash and hash triggers after whitespace in input
2026-08-18 14:16:04 +08:00
朱昆鹏 fa4fcc5956 Merge pull request #1676 from hpstream/fix/v0.5.3-hp
fix(v0.5.3): Grok 编辑统计/历史回显与 Claude settings 同步安全
2026-08-18 13:36:15 +08:00
Gadfly a0b6ea6307 fix(webview): keep action dialog borders in view
Keep question and plan-approval cards inset from tool-window edges so JCEF cannot clip their rounded borders. Preserve stretched collapsed layouts when the overlay aligns its children to the end.
2026-08-18 11:09:05 +08:00
Gadfly f772a7ffb7 fix(webview): keep Agent blocks mounted during streaming updates
Stabilize Agent group keys and navigation callbacks so streaming identity
updates do not remount message blocks or invalidate MessageList memoization.
2026-08-17 21:47:57 +08:00
hebulin 04f6e4ef88 fix(model): migrate retired claude-sonnet-4-7 default instead of pinning dead model
claude-sonnet-4-7 was retired from the Anthropic API but remains the
default model hardcoded in both the webview (DEFAULT_CLAUDE_MODEL_ID,
default props) and the Java side (SessionState, HandlerContext,
ChatWindowDelegate, ClaudePricingTable). Every flow that falls back to
the default - or restores a persisted tab that had Sonnet 4.7 selected -
now fails on every send:

  There is an issue with the selected model (claude-sonnet-4-7[1m]).
  It may not exist or you may not have access to it.

LEGACY_CLAUDE_MODEL_ID_ALIASES also mapped sonnet-4-6 -> sonnet-4-7,
i.e. one retired id to another retired id, so normalizeClaudeModelId()
kept returning a dead id (#1678).

Webview:
- DEFAULT_CLAUDE_MODEL_ID: sonnet-4-7 -> sonnet-5 (same-tier successor)
- legacy aliases now map every retired id to a live model:
  sonnet-4-6/sonnet-4-7 -> sonnet-5, opus-4-6 -> opus-4-8
- remove claude-sonnet-4-7 from CLAUDE_MODELS and sonnet47 i18n entries;
  move the "Use the default model" description to Sonnet 5 (all locales)
- default selectedModel props use DEFAULT_CLAUDE_MODEL_ID instead of
  duplicated literals

Java:
- sync all four defaults to claude-sonnet-5
- SessionState.setModel() migrates retired ids on write so restored
  .idea/claudeCodeTabState.xml tabs self-heal instead of spawning a CLI
  pinned to a dead model; [1m] suffix is preserved
- lookup-table entries (pricing/context-limit/effort sets) keep the
  retired ids so historical usage stats keep resolving

Fixes #1678
2026-08-17 09:14:20 +08:00
hpstream 6cc486f0c0 feat(webview): session net file-change stats with multi-agent marks
Replace per-edit +/− summation with a session ledger (baseline→current
diff), recognize Search Replace style tools, mark multi-agent/cross-tab
touches on the same file, and cover the behavior with unit tests.
2026-08-16 00:47:50 +08:00
hpstream f15bbfcf78 revert: remove shell file-modification setting and interceptors
The allowShellFileModification switch and policy did not provide reliable
pre-execution blocking for Codex (and only partial coverage elsewhere), so
remove the setting, UI, env, and Claude/Codex/Grok interception paths.
2026-08-15 23:21:08 +08:00
hpstream 18937f5dd8 fix(history): ensure Grok transcript paints on first open
Root causes for blank history until switch-away-and-back:
1) historyLoadComplete fired before StreamMessageCoalescer flushed
   updateMessages, releasing the transition guard with an empty stash.
2) clearMessages wiped a post-barrier stashed snapshot when IPC reordered.
3) Same-session Grok reopen began a transition (cleared UI) while the
   backend soft-reloaded without historyLoadComplete.

Flush the coalescer before historyLoadComplete, preserve post-barrier
deferred snapshots, soft-reload non-Codex same sessions without wiping,
and always complete soft reloads with historyLoadComplete.
2026-08-15 19:39:52 +08:00
hpstream 9e7b79bbda fix: apply deferred updateMessages after session transition
History loads that finished while __sessionTransitioning was true used to
be dropped permanently because historyLoadComplete never re-applied them.
Stash the latest snapshot during the guard and flush it when the
transition is released (historyLoadComplete / setSessionId / timeout).
2026-08-15 19:28:41 +08:00
hpstream 225fa00822 feat: block shell file writes by default for tracked AI edits
Add allowShellFileModification (default off) so file changes go through
Edit/Write for StatusPanel stats. Deny Bash-like tools that look like
they mutate files; when the setting is on, allow them with a no-stats
warning in the permission dialog.
2026-08-15 19:07:55 +08:00
GGMGG 9104351dac feat(codex-pet): refine settings panels 2026-08-14 15:48:02 +08:00
GGMGG 9a6133668b feat(codex-pet): redesign settings workspace 2026-08-13 17:55:49 +08:00
hebulin b0b7761c30 fix(chat): allow slash and hash triggers after visible whitespace
detectSlashTrigger and detectHashTrigger only fired when the trigger
character was at the absolute line start. Typing content first made / and
# unreachable without clearing the input or inserting a newline.

Allow the trigger when preceded by visible whitespace (space, tab, etc.)
so users can type content, press space, then type / or # — matching the
existing ! and $ triggers and the CLI. Zero-width invisible characters
(ZWSP/ZWNJ/BOM) are still treated transparently by isLineStart and are
NOT counted as a separating space, so 'a<zwsp>/rev' still does not
trigger.

Fixes #1661
2026-08-13 16:14:16 +08:00
GGMGG daea8a8c9b fix(webview): hide opaque spawn agent prompts 2026-08-13 12:15:25 +08:00
GGMGG 6afc2303fa fix(codex): isolate plan state to current turn 2026-08-13 12:02:17 +08:00