Commit Graph
5 Commits
Author SHA1 Message Date
ework-agent 841de6aba2 test(#2075): update stale wire-shape assertions for the #2072 nativeCaller stamp
The first commit updated only tests/plugin-agent.test.ts, leaving four
/acp-cache forwarding assertions pinning the pre-#2072 body shape (no
nativeCaller field) in dsh-acp / opencode-acp-command / opencode-v2 —
CI's full suite caught them. Add nativeCaller: true to each expected
body (the new host-native contract), widen the ToolCall capture type in
opencode-acp-command.test.ts accordingly.
2026-10-04 18:52:22 +08:00
ework-agent 7b6fdc2f86 test(acp): fix type errors in the new #1603 cases under the root tsconfig gate
The three new /acp cases used optional-chaining invocation (`?.()`),
yielding Promise<void> | undefined — no assert.rejects overload matches
under tsconfig.json (the CI gate). Use the file's existing non-null
invocation (`!()`) instead. Type-only; runtime unchanged (12/12).
2026-10-04 13:32:16 +08:00
ework-agent a2999ff413 feat(agent): surface stale install in the /acp status panel (#1603)
In plugin mode (opencode/pi/dsh) the proxy can't exit on its own, so a long-
lived host keeps running stale code after auto-update installs a newer version
on disk -- the 'restart bili' warnings go unseen (37x in one field log). This
makes staleness visible where the user/model actually looks: the interactive
/acp command now appends a one-line warning when /__bili/status reports stale
(running vs installed), pointing at restarting the host or enabling
--auto-restart-on-update. Display-only (ignored:true synthetic message), so it
never pollutes model context; probe soft-fails so an unreachable status endpoint
can't break /acp.

Docs (README en+zh): note that 'restart bili' means restarting the HOST for
plugin lanes, and document the new bounded-retry/backoff behavior for persistent
install failures (commit 1). No new config/env/CLI surface added.

Closes part of #1603 (Defect 1).
2026-10-04 13:23:51 +08:00
ework-agent 2e6e508aa8 test: gate tests/ under root-tsconfig typecheck; clear all pre-existing test type errors
Closes #1970

- package.json: npm run typecheck now targets the root tsconfig.json
  (include: src + tests) instead of tsconfig.build.json (src only);
  all four CI workflows inherit the widened gate via the script.
- tsconfig.json: lib ES2022 -> ES2024 (type-only; tests use
  Promise.withResolvers & co.; src stays clean under it; no effect on
  tsup/esbuild output).
- 276 test files: type-level-only fixes (import sources, missing
  fixture fields filled with src-default values, narrowing, explicit
  annotations, single-expression casts). No assertion changes, no
  runtime behavior changes.
- src/agent/dsh-acp.ts: export CommandOutcome / CommandsService types
  (type-only; erased at build).
2026-10-03 20:07:48 +08:00
ework-agent def6d9e0e1 feat: /acp-cache command for all clients with a command seam (#1146)
Register the human entry point to the acp_cache prompt-cache reconciliation report on every client that has a user-typable command surface, in both native mode and bili launcher mode:

- pi/omp: already covered via the shared factory (/acp-cache [full])
- opencode V1 (launcher + native): /acp-cache [full] in createAcpCommandHooks; report rendered as an ignored message wrapped in [acp-cache] markers, which the proxy strips from model context by content signature before it reaches the wire
- opencode V2: /acp-cache [full] via ctx.command.transform; rendered as a synthetic message (inert body, report in the visible description, 8 KB cap vs the 1 KB panel cap because the report tail is payload)
- dsh (launcher-injected + native profile): session-bound acp_cache forward (initiator session id, latest-conversation fallback); default detail only - the dsh command API passes no arguments
- legacy opencode-acp sessions (#920): explicit unavailable notice instead of a raw 404 (their traffic bypasses this proxy's compression state)
- Claude Code: no in-process command API; bili plugin install claude now also writes <configdir>/commands/acp-cache.md (model-mediated markdown command driving the acp_cache MCP tool), content-owned install/remove never clobbers foreign files
- codex/kimi/hermes: no user-typable command seam exists - documented, acp_cache remains reachable model-side via the bili MCP server
2026-09-23 19:24:11 +08:00