agentgui 1.0.921 → 1.0.923

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -73,4 +73,16 @@ Only after the real generator is patched will agentgui sessions run autonomously
73
73
 
74
74
  **acptoapi (c:\dev\acptoapi) merged Claude Code history routes as of 2026-05-02; ccsniff package is no longer needed.**
75
75
 
76
- History functionality (`GET /v1/history/*` endpoints) is now built into acptoapi. Routes: `snapshot` (event/session/project/tool/error counts + byte/date range), `sessions` (list with title/project/cwd/counts), `sessions/:sid/events` (flattened events), `search` (BM25 with snippets), `reindex` (rebuild index), `stream` (SSE). Implementation: `lib/history/` (bm25.js for tokenize/buildIndex/search/snippet, watcher.js for JsonlWatcher + JsonlReplayer, index.js for HistoryStore singleton + flattenEvent). Reads `~/.claude/projects` by default; override with `CLAUDE_PROJECTS_DIR` env var. The ccsniff package itself is no longer required — acptoapi covers the functionality entirely.
76
+ History functionality (`GET /v1/history/*` endpoints) is now built into acptoapi. Routes: `snapshot` (event/session/project/tool/error counts + byte/date range), `sessions` (list with title/project/cwd/counts), `sessions/:sid/events` (flattened events), `search` (BM25 with snippets), `reindex` (rebuild index), `stream` (SSE). Implementation: `lib/history/` (bm25.js for tokenize/buildIndex/search/snippet, watcher.js for JsonlWatcher + JsonlReplayer, index.js for HistoryStore singleton + flattenEvent). Reads `~/.claude/projects` by default; override with `CLAUDE_PROJECTS_DIR` env var. The ccsniff package itself is no longer needed — acptoapi covers the functionality entirely.
77
+
78
+ ## buildSystemPrompt System Prompt for claude-code
79
+
80
+ **`lib/provider-config.js` buildSystemPrompt() must return '' for claude-code agent; returning "Model: X." breaks conversation resume.**
81
+
82
+ The function previously returned "Model: X." when agentId was 'claude-code' and model was non-null. This caused `buildArgs` in lib/claude-runner-agents.js to pass `--append-system-prompt "Model: X."` to the claude CLI, which triggers "argument missing" error on conversation resume. Fix: return '' early when agentId is 'claude-code' or falsy. The model is already passed via `--model` flag; system prompt is only for non-claude-code agents.
83
+
84
+ ## WebSocket Sync Endpoint Testing
85
+
86
+ **WebSocket `/sync` endpoint — message ordering requires registering handler BEFORE sending.**
87
+
88
+ Server sends `sync_connected` with `clientId` on connect. Legacy handler (`lib/ws-legacy-handlers.js`) handles `ping→pong`, `subscribe→subscription_confirmed`, `get_subscriptions→subscriptions`, `unsubscribe`, `latency_report`. All responses use codec encode/decode (`lib/codec.js`). Pattern: queue outbound messages and use a waiters array + sequential promises to avoid race between send and handler registration. Test structure: `const queued = []; let waiting; ws.on('message', ...); queued.forEach(msg => ws.send(msg)); waiting.resolve(...)` ensures the handler is live before messages flow.
@@ -3,11 +3,10 @@ import path from 'path';
3
3
  import os from 'os';
4
4
 
5
5
  export function buildSystemPrompt(agentId, model, subAgent) {
6
+ if (!agentId || agentId === 'claude-code') return '';
6
7
  const parts = [];
7
- if (agentId && agentId !== 'claude-code') {
8
- const displayAgentId = agentId.split('-·-')[0];
9
- parts.push(`Use ${displayAgentId} subagent for all tasks.`);
10
- }
8
+ const displayAgentId = agentId.split('-·-')[0];
9
+ parts.push(`Use ${displayAgentId} subagent for all tasks.`);
11
10
  if (model) parts.push(`Model: ${model}.`);
12
11
  if (subAgent) parts.push(`Subagent: ${subAgent}.`);
13
12
  return parts.join(' ');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.921",
3
+ "version": "1.0.923",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",