1964 Commits

Author SHA1 Message Date
朱昆鹏 42f9786624 Merge pull request #1707 from zhukunpenglinyutong/feature/v0.5.4
Feature/v0.5.4
v0.5.4
2026-08-26 15:52:46 +08:00
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 591ee6b610 chore: restore plugin version to 0.5.4 2026-08-26 15:17:41 +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 3b5feff1da fix: address PR review blockers (plan-usage units, legacy auth backup, Windows dsh preset)
- claude: parse rate_limit_event resetsAt as epoch seconds (the CLI emits
  seconds, not millis) and prefer rateLimitType over the reset-delta
  heuristic for 5h/7d window classification
- claude: scale over-capacity utilization (>1.0) to a real percent instead
  of clamping it to ~1%
- codex: back up an unmanaged auth.json before the first post-upgrade
  provider transition overwrites it, and preserve it when leaving a legacy
  managed provider without a backup
- dsh: spawn --dump-config through resolveCliSpawn so Windows .cmd shims
  launch via cmd.exe instead of silently failing with EINVAL
2026-08-26 15:01:22 +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
朱昆鹏 525331e1e1 Merge pull request #1731 from hebulin/fix/daemon-sdk-lazy-load
fix(daemon): signal ready before SDK preload to unblock Java startup
2026-08-26 11:19:55 +08:00
朱昆鹏 e11dccad8d Merge pull request #1733 from gadfly3173/fix/claude-thinking-block-boundaries
fix(claude): preserve thinking block boundaries in streaming output
2026-08-26 10:32:52 +08:00
Gadfly ae470f578e fix(claude): flush buffered deltas before block-reset clears the throttlers
Frequent mid-response BLOCK_RESET markers (one per content-block edge)
were silently discarding deltas still sitting in the 33ms throttle
window, so thinking text stopped streaming and only appeared via
updateMessages snapshots. Flush both throttlers to the frontend before
resetting, with a regression test covering the ordering.
2026-08-25 18:28:45 +08:00
Gadfly 166fa14f5c fix(claude): preserve thinking blocks across streamed assistant messages 2026-08-25 15:39:48 +08:00
Gadfly 6bb90fb01e fix(claude): preserve thinking block boundaries in legacy stream path 2026-08-25 13:45:30 +08:00
hebulin fa2010cce6 fix(daemon): signal ready before SDK preload to unblock Java startup
The daemon previously awaited preloadSdks() before sending the ready
event, blocking the Java plugin's DaemonBridge startup for the full
Claude Agent SDK import duration (potentially seconds on slow disks).

Move the ready signal before preloadSdks(). The SDK is now loaded in
the background; acquireRuntime() already lazy-loads via ensureQueryFn()
with its own promise cache, so the first send simply waits for the
in-flight load instead of blocking daemon startup. Heartbeat and status
commands become available immediately.

Also emit a sdk_ready event when the background preload completes, so
the Java side can log the transition for diagnostics.
2026-08-25 11:10:23 +08:00
zhukunpenglinyutong 9358a65b7b fix(settings): harden startup repair sync with empty-env guard and unified skip logic
- Mirror ClaudeSettingsSyncPlan's empty-env invariant in the repair path:
  a provider with an empty/missing settingsConfig.env payload is incomplete
  state and must not stamp model/codemossProviderId into settings.json
- Extract isGlobalSettingsSyncExempt() so apply and repair paths share one
  skip list (local settings / CLI login / disabled); repair previously
  omitted DISABLED_PROVIDER_ID
- Treat a missing settingsConfig as a graceful no-op instead of throwing
  IllegalArgumentException on every chat window open
- Add regression tests for disabled mode, empty-env provider, and missing
  settingsConfig; fix tearDown to restore a null home cache and clean up
  the temp directory
2026-08-24 22:50:48 +08:00
朱昆鹏 a2098577b3 Merge pull request #1391 from HardBrick21/fix/smart-config-sync
feat: implement smart config sync to preserve user manual changes
2026-08-24 22:41:39 +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
hardbrick21 1b6aafe09c Fix missing JsonElement import 2026-08-24 20:37:10 +08:00
hardbrick21 9bca97a284 Merge remote-tracking branch 'zhukunpenglinyutong/feature/v0.5.4' into fix/smart-config-sync
# Conflicts:
#	src/main/java/com/github/claudecodegui/ui/ChatWindowDelegate.java
2026-08-24 20:12:58 +08:00
朱昆鹏 06b2688c57 Merge pull request #1723 from hebulin/fix/1721-mcp-stdio-container-leak
fix(mcp): close stdin before signalling stdio servers to stop container leaks
2026-08-24 20:11:03 +08:00
朱昆鹏 f637078322 Merge pull request #1724 from hebulin/fix/1722-mcp-env-var-expansion
fix(mcp): expand ${VAR} placeholders in .mcp.json env from settings files
2026-08-24 20:05:10 +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
朱昆鹏 c2306deeb9 Merge pull request #1727 from elexiang/codex/fix-file-reference-boundaries-v054
fix(input): preserve text between external file references
2026-08-24 19:22:13 +08:00
he_dai_xiang 7d816f6522 fix(input): preserve text between external file references 2026-08-24 17:23:45 +08:00
hebulin 4700ba6dbb fix(mcp): expand ${VAR} placeholders in .mcp.json env from settings files
Claude Code expands ${VAR} placeholders found in .mcp.json using the
env section of .claude/settings.local.json (project) and
.claude/settings.json (user), falling back to the process environment.
The plugin read the same config but passed placeholders through
literally, so spawned MCP servers received e.g.
DATABASE_URI=${NEXUS_MCP_DB_URI} verbatim - postgres-mcp then logged a
warning and kept running forever with a useless connection string
(#1722).

- config-loader: after resolving global/project mcpServers, expand
  ${VAR} in every server env value. Lookup order: project
  settings.local.json env -> user settings.json env -> process.env
- Unresolvable placeholders are left as-is so misconfiguration stays
  visible instead of silently becoming empty strings
- Original configs are not mutated; expansion happens on a copy

Closes #1722
2026-08-24 14:31:22 +08:00
hebulin e00fb80e75 fix(mcp): close stdin before signalling stdio servers to stop container leaks
Killing a `docker run -i --rm ...` MCP server's client process only
signals the Docker CLI, not the container: the container keeps running
and --rm never fires, so every MCP status refresh leaked one container
permanently (67 containers / 4.2 GB RAM after ~12h on the reporter's
machine) (#1721).

safeKillProcess now closes the child's stdin FIRST - EOF propagates to
the container's stdin, so a well-behaved dockerised MCP server exits on
its own and --rm cleans it up - and only falls back to SIGTERM/SIGKILL
after a 500ms grace period for local processes that don't react to EOF.
Early-exit guards (exitCode/signalCode/writableEnded) make repeated
calls and racing with natural exit safe.

Closes #1721
2026-08-24 14:30:47 +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
zhukunpenglinyutong 52696f0b60 fix(dsh): preset switching follow-ups
- sweep stale dsh-preset-*.patch overlays before each spawn instead of
  letting them pile up in the state dir
- warn when a preset is requested but the running host was started
  externally and cannot be reloaded, instead of silently ignoring it
- align the Java-side preset id list with the JS side (router-standard)
- fix preset-dir file URL on POSIX: file:////tmp/... resolved to a broken
  //tmp/... pathname; build it via pathToFileURL instead
- add node:test unit tests for preset-overlay (14 cases)
2026-08-22 16:39:13 +08:00
朱昆鹏 b36e486229 Merge pull request #1718 from yibeiqingke/feat/dsh-agent-presets
feat(dsh): add agent preset switching
2026-08-22 16:24:20 +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
朱昆鹏 b03e8b8aa7 Merge pull request #1572 from hebulin/fix/1509-model-routing-env-override
fix(bridge): clear model routing env vars in settings override to prevent model mismatch
2026-08-22 13:36:55 +08:00
zhukunpenglinyutong 184930a7ef fix(grok): word-boundary provider detection and indentation cleanup
- NodeProcessRegistry.detectProviderFromCmd: match grok/gemini on word
  boundaries so coincidental path segments (e.g. username "grokky")
  no longer mislabel processes in the Node process panel
- SessionSendService: fix sendToGrok / sendToCliProvider indentation
- NodeProcessRegistryHelpersTest: pin substring false-positive cases
  and .antig-grok style real paths
2026-08-22 13:27:45 +08:00
朱昆鹏 1def7a1444 Merge pull request #1711 from toxeh/feat/grok-persistent-runtime
feat(grok): persistent Grok ACP runtime daemon
2026-08-22 13:17:55 +08:00
朱昆鹏 defc62ace8 Merge pull request #1717 from 15265782641/fix/dsh-configured-model
fix(dsh): preserve configured model in picker
2026-08-22 13:08:59 +08:00
anlter facf833575 fix(dsh): preserve configured model in picker
- resolve the configured provider/model from host.describe
- insert the default route if llm.models omits it
- retain the default model when the catalog request fails
2026-08-22 12:31:22 +08:00
toxeh 6ae079afc6 feat(grok): persistent Grok ACP runtime daemon
Replace the per-request GrokCliBridge with a persistent ACP daemon runtime:

- Route grok through GrokSDKBridge in SessionProviderRouter (removed from
  CLI_PROVIDER_IDS) and delete the dead GrokCliBridge
- GrokDaemonCoordinator keeps a single ACP process alive across turns;
  NodeProcessRegistry learns shared collectDaemonEntry/collectChannelEntries
  helpers so Claude and Grok daemons survive "kill orphans" sweeps
- grok-event-normalizer converts Grok's snapshot-style chunks into true
  deltas (#emitChunk): no duplicated or resurrected text, independent
  content/thinking accumulators, nested/array content shapes
- grok-acp-client liveness checks use exitCode instead of the unreliable
  killed flag
- CodemossSettingsService persists grok.env custom environment injected
  into daemon processes
- PathUtils.guardWorkingDirectory protects daemon cwd against deleted
  project dirs

Tests: NodeProcessRegistryHelpersTest, PathUtilsGuardWorkingDirectoryTest,
CodemossSettingsServiceGrokEnvTest, grok-event-normalizer.dedup.test.js,
grok-acp-timeout.test.js, DaemonBridgeTest.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 18:16:13 -04: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 ac01bee7ce refactor: replace provider equals-chain with SUPPORTED_PROVIDERS set in CliModelsHandler 2026-08-22 00:07:34 +08:00
zhukunpenglinyutong 471f4cef2e refactor: remove unused nameHint in OmpHistoryReader.resolveSessionFile 2026-08-21 23:59:10 +08:00
朱昆鹏 a9877481df Merge pull request #1658 from Sojiroh/feature/omp
feat: add OMP CLI provider
2026-08-21 23:55:38 +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
zhukunpenglinyutong ba91d994ad fix: offload remaining Node.js detection/verification off the EDT
PR #1659 moved auto-detection off the EDT in ChatWindowDelegate, but two
synchronous call sites remained that could still freeze the IDE in
VM/container environments where detection subprocesses hang:

- WebviewInitializer.createUIComponents ran detectNodeWithDetails()
  synchronously on the EDT when no saved path existed (and had a dead
  re-detection fallback before the version gate)
- WebviewInitializer.handleNodePathSave ran detection and path
  verification synchronously on the EDT from the error panel callbacks

Detection and verification now run on a pooled thread, with UI updates
dispatched back to the EDT. On detection failure the bridges fall back
to invoking "node" by name (matching NodeDetector.findNodeExecutable),
so checkEnvironment can still pass when node is on PATH but the probes
failed. The saved-path fast path is unchanged.
2026-08-21 22:48:16 +08:00