diff --git a/.changeset/core-command-lister-ephemeral.md b/.changeset/core-command-lister-ephemeral.md new file mode 100644 index 0000000..d8150c8 --- /dev/null +++ b/.changeset/core-command-lister-ephemeral.md @@ -0,0 +1,9 @@ +--- +'@agent-devtools/core': patch +--- + +fix(core): keep the command-lister ACP session ephemeral so it stops logging a `resourceNotFound` on every dev-server restart + +The command-lister session (`GET /v1/agent/commands`) only lists slash commands and never carries a conversation turn, so the agent never writes a transcript for it. It was nonetheless persisted in the `(cwd, clientSessionId) → acpSessionId` store like a chat session, so after a dev-server restart the runtime tried to `loadSession` an id the agent could not resume — the agent (Claude Code) emitted `[acp-child] … session/load … -32002 Resource not found` to stderr on every page reload. The failure was already caught and fell back to `newSession` (commands still returned 200), but the noise was alarming and looked like a broken integration. + +`getOrCreateSession` now treats the reserved command-lister key as store-exempt: it skips both the resume attempt and the persistence write, minting a fresh session each run. Chat sessions are unaffected and still resume across restarts. Verified end-to-end: a real chat session resumes correctly after a restart, while the command-lister no longer triggers the `session/load` error. diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 0000000..0181058 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,37 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "@agent-devtools/docs": "0.0.8", + "@agent-devtools/example-angular-vite": "0.0.0", + "@agent-devtools/example-html": "0.0.0", + "@agent-devtools/example-next": "0.0.0", + "@agent-devtools/example-next-pages": "0.0.0", + "@agent-devtools/example-nuxt": "0.0.0", + "@agent-devtools/example-nuxt2": "0.0.0", + "@agent-devtools/example-react-vite": "0.0.0", + "@agent-devtools/example-svelte-vite": "0.0.0", + "@agent-devtools/example-sveltekit": "0.0.0", + "@agent-devtools/example-vue-vite": "0.0.0", + "@agent-devtools/example-vue2-vite": "0.0.0", + "@agent-devtools/angular": "1.3.2", + "@agent-devtools/core": "1.3.2", + "@agent-devtools/e2e": "0.0.0", + "@agent-devtools/harness-core": "1.3.2", + "@agent-devtools/html": "1.3.2", + "@agent-devtools/next": "1.3.2", + "@agent-devtools/next-pages": "1.3.2", + "@agent-devtools/nuxt": "1.3.2", + "@agent-devtools/nuxt2": "1.3.2", + "@agent-devtools/react": "1.3.2", + "@agent-devtools/svelte": "1.3.2", + "@agent-devtools/sveltekit": "1.3.2", + "@agent-devtools/vite": "1.3.2", + "@agent-devtools/vue": "1.3.2", + "@agent-devtools/vue2": "1.3.2", + "@agent-devtools/widget-core": "1.3.2" + }, + "changesets": [ + "core-command-lister-ephemeral" + ] +} diff --git a/packages/angular/CHANGELOG.md b/packages/angular/CHANGELOG.md index edf9d04..a97b7ea 100644 --- a/packages/angular/CHANGELOG.md +++ b/packages/angular/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/angular +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/angular/package.json b/packages/angular/package.json index e3ab86c..488b6d7 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/angular", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Angular adapter for agent-devtools — Ivy component walker + DOM picker + closed Shadow DOM widget", "keywords": [ "agent-devtools", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 224fc4d..da80363 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 1.3.3-beta.0 + +### Patch Changes + +- [#18](https://github.com/Seungwoo321/agent-devtools/pull/18) [`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7) Thanks [@Seungwoo321](https://github.com/Seungwoo321)! - fix(core): keep the command-lister ACP session ephemeral so it stops logging a `resourceNotFound` on every dev-server restart + + The command-lister session (`GET /v1/agent/commands`) only lists slash commands and never carries a conversation turn, so the agent never writes a transcript for it. It was nonetheless persisted in the `(cwd, clientSessionId) → acpSessionId` store like a chat session, so after a dev-server restart the runtime tried to `loadSession` an id the agent could not resume — the agent (Claude Code) emitted `[acp-child] … session/load … -32002 Resource not found` to stderr on every page reload. The failure was already caught and fell back to `newSession` (commands still returned 200), but the noise was alarming and looked like a broken integration. + + `getOrCreateSession` now treats the reserved command-lister key as store-exempt: it skips both the resume attempt and the persistence write, minting a fresh session each run. Chat sessions are unaffected and still resume across restarts. Verified end-to-end: a real chat session resumes correctly after a restart, while the command-lister no longer triggers the `session/load` error. + ## 1.3.2 ## 1.3.2-beta.0 diff --git a/packages/core/package.json b/packages/core/package.json index cc06778..3448912 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/core", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Framework-agnostic core for agent-devtools — server, agent engine, widget shell", "keywords": [ "agent-devtools", diff --git a/packages/core/src/providers/acp-runtime.test.ts b/packages/core/src/providers/acp-runtime.test.ts index 69a7499..d293c4a 100644 --- a/packages/core/src/providers/acp-runtime.test.ts +++ b/packages/core/src/providers/acp-runtime.test.ts @@ -420,6 +420,35 @@ describe('createDefaultAcpRuntime — session-store wiring', () => { expect(store.deleteCalls).toHaveLength(0); }); + it('keeps the command-lister session ephemeral — never consults the store or calls loadSession', async () => { + const store = makeInMemoryStore(); + // A stale command-lister entry left by a previous boot. It can never be + // resumed (the lister never has a transcript), so the runtime must ignore + // it instead of attempting a loadSession that always fails with -32002. + // Seed the underlying map directly so the recorder reflects only the + // runtime's own store traffic, not this setup. + store.state.set('/workspace __agent-devtools:command-lister__', 'acp-stale-lister'); + + const { runtime, harness } = await setup(store, { + commandsOnNewSession: { commands: [{ name: 'foo', description: 'bar' }] }, + }); + + const commands = await runtime.listCommands({ + cwd: '/workspace', + signal: new AbortController().signal, + }); + + expect(commands.map((c) => c.name)).toContain('foo'); + // No resume attempt for the reserved key — it mints a fresh session... + expect(harness.recorder.loadSessionCalls).toHaveLength(0); + expect(harness.recorder.newSessionCalls).toHaveLength(1); + // ...and the store is never touched for the command-lister key. + expect(store.getCalls).not.toContainEqual(['/workspace', '__agent-devtools:command-lister__']); + expect(store.setCalls.some(([, cs]) => cs === '__agent-devtools:command-lister__')).toBe(false); + // The stale entry is left as-is (not deleted) — we simply don't read it. + expect(store.deleteCalls).toHaveLength(0); + }); + it('in-process cache hit short-circuits the store on the second run within one runtime', async () => { const store = makeInMemoryStore(); const { runtime, harness } = await setup(store); diff --git a/packages/core/src/providers/acp-runtime.ts b/packages/core/src/providers/acp-runtime.ts index 8230e8c..40ab659 100644 --- a/packages/core/src/providers/acp-runtime.ts +++ b/packages/core/src/providers/acp-runtime.ts @@ -477,7 +477,14 @@ class AcpChild { // Phase 1: try to resume a session persisted across dev-server // restarts. Only meaningful when (a) we have a store and (b) the // agent supports session/load. - const store = this.deps.sessionStore; + // + // The command-lister session is exempt: it only ever lists slash commands + // and never carries a conversation turn, so the agent writes no transcript + // for it. A persisted id would therefore always fail `loadSession` after a + // restart — an expected `resourceNotFound` that surfaces as noisy agent + // stderr on every reload. Keep it ephemeral (skip the store) so it just + // mints a fresh session each run instead of attempting an unresumable load. + const store = clientSessionId === COMMAND_LISTER_SESSION_KEY ? null : this.deps.sessionStore; if (store && this.supportsLoadSession) { const stored = await store.get(cwd, clientSessionId); if (stored !== undefined) { diff --git a/packages/harness-core/CHANGELOG.md b/packages/harness-core/CHANGELOG.md index da70a64..367be8a 100644 --- a/packages/harness-core/CHANGELOG.md +++ b/packages/harness-core/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## 1.3.3-beta.0 + ## 1.3.2 ## 1.3.2-beta.0 diff --git a/packages/harness-core/package.json b/packages/harness-core/package.json index 3ce069e..cbfbb41 100644 --- a/packages/harness-core/package.json +++ b/packages/harness-core/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/harness-core", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Generic agent harness — domain-agnostic loop strategies + LLM provider abstraction. Source for both @agent-devtools and external SaaS consumers.", "license": "MIT", "type": "module", diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md index 09744d8..08e03e4 100644 --- a/packages/html/CHANGELOG.md +++ b/packages/html/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/html +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies []: + - @agent-devtools/vite@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/html/package.json b/packages/html/package.json index 14c32d9..f62a89c 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/html", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "npx runner for agent-devtools — serve a plain HTML folder with the dev-only widget injected, no framework, no config", "keywords": [ "agent-devtools", diff --git a/packages/next-pages/CHANGELOG.md b/packages/next-pages/CHANGELOG.md index 6f04060..63328e6 100644 --- a/packages/next-pages/CHANGELOG.md +++ b/packages/next-pages/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/next-pages +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/react@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/next-pages/package.json b/packages/next-pages/package.json index 6c1b72f..3233245 100644 --- a/packages/next-pages/package.json +++ b/packages/next-pages/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/next-pages", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Next.js Pages Router adapter for agent-devtools — wraps the React widget for legacy pages/_app.tsx hosts", "keywords": [ "agent-devtools", diff --git a/packages/next/CHANGELOG.md b/packages/next/CHANGELOG.md index e687dc8..c9fceb0 100644 --- a/packages/next/CHANGELOG.md +++ b/packages/next/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/next +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/react@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/next/package.json b/packages/next/package.json index bab8de6..09eb04f 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/next", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Next.js 15 adapter for agent-devtools — re-exports the React widget + adds App / Pages router dev-only injection", "keywords": [ "agent-devtools", diff --git a/packages/nuxt/CHANGELOG.md b/packages/nuxt/CHANGELOG.md index 6019733..05bf197 100644 --- a/packages/nuxt/CHANGELOG.md +++ b/packages/nuxt/CHANGELOG.md @@ -1,5 +1,14 @@ # @agent-devtools/nuxt +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/vue@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 8596082..39f4577 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/nuxt", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Nuxt 3 module for agent-devtools — re-exports the Vue widget + adds dev-only injection through defineNuxtModule", "keywords": [ "agent-devtools", diff --git a/packages/nuxt2/CHANGELOG.md b/packages/nuxt2/CHANGELOG.md index e8b5265..234b266 100644 --- a/packages/nuxt2/CHANGELOG.md +++ b/packages/nuxt2/CHANGELOG.md @@ -1,5 +1,14 @@ # @agent-devtools/nuxt2 +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/vue2@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/nuxt2/package.json b/packages/nuxt2/package.json index cf3f781..8960ffd 100644 --- a/packages/nuxt2/package.json +++ b/packages/nuxt2/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/nuxt2", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Nuxt 2 module for agent-devtools — re-exports the Vue 2 widget + adds dev-only injection through the Nuxt 2 module API", "keywords": [ "agent-devtools", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 1912362..ac7d1a4 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index ca6cdca..5679b3c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/react", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "React 19 adapter for agent-devtools — fiber walker + DOM picker + closed Shadow DOM widget", "keywords": [ "agent-devtools", diff --git a/packages/svelte/CHANGELOG.md b/packages/svelte/CHANGELOG.md index 49ee7ed..556f89b 100644 --- a/packages/svelte/CHANGELOG.md +++ b/packages/svelte/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/svelte +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 5210a21..26cc34a 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/svelte", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Svelte adapter for agent-devtools — Svelte 4/5 component walker + DOM picker + closed Shadow DOM widget", "keywords": [ "agent-devtools", diff --git a/packages/sveltekit/CHANGELOG.md b/packages/sveltekit/CHANGELOG.md index e58f52e..ae7b408 100644 --- a/packages/sveltekit/CHANGELOG.md +++ b/packages/sveltekit/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/sveltekit +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/svelte@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/sveltekit/package.json b/packages/sveltekit/package.json index 2b41520..fb95b27 100644 --- a/packages/sveltekit/package.json +++ b/packages/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/sveltekit", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "SvelteKit adapter for agent-devtools — dev-only handle hook + Svelte adapter mount", "keywords": [ "agent-devtools", diff --git a/packages/vite/CHANGELOG.md b/packages/vite/CHANGELOG.md index 0bb6467..71945d2 100644 --- a/packages/vite/CHANGELOG.md +++ b/packages/vite/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/vite +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/vite/package.json b/packages/vite/package.json index e7a1426..18f5a9b 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/vite", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Vite plugin for agent-devtools — auto-spawn agent server + dev-only widget injection (Vite 5+)", "keywords": [ "agent-devtools", diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index 604ee24..f6d89d8 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/vue +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/vue/package.json b/packages/vue/package.json index 5d6eac6..8d1d463 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/vue", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Vue 3 adapter for agent-devtools — vnode walker + DOM picker + closed Shadow DOM widget", "keywords": [ "agent-devtools", diff --git a/packages/vue2/CHANGELOG.md b/packages/vue2/CHANGELOG.md index a93f908..db8a967 100644 --- a/packages/vue2/CHANGELOG.md +++ b/packages/vue2/CHANGELOG.md @@ -1,5 +1,13 @@ # @agent-devtools/vue2 +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + - @agent-devtools/widget-core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/vue2/package.json b/packages/vue2/package.json index 9cd18dd..298ce4b 100644 --- a/packages/vue2/package.json +++ b/packages/vue2/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/vue2", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Vue 2 adapter for agent-devtools — Vue 2.7 component walker + DOM picker + closed Shadow DOM widget", "keywords": [ "agent-devtools", diff --git a/packages/widget-core/CHANGELOG.md b/packages/widget-core/CHANGELOG.md index 2f15226..3a137ef 100644 --- a/packages/widget-core/CHANGELOG.md +++ b/packages/widget-core/CHANGELOG.md @@ -1,5 +1,12 @@ # @agent-devtools/widget-core +## 1.3.3-beta.0 + +### Patch Changes + +- Updated dependencies [[`469188f`](https://github.com/Seungwoo321/agent-devtools/commit/469188f05949c641c01cc603e99672524bc202e7)]: + - @agent-devtools/core@1.3.3-beta.0 + ## 1.3.2 ### Patch Changes diff --git a/packages/widget-core/package.json b/packages/widget-core/package.json index 69bd804..c4b8f42 100644 --- a/packages/widget-core/package.json +++ b/packages/widget-core/package.json @@ -1,6 +1,6 @@ { "name": "@agent-devtools/widget-core", - "version": "1.3.2", + "version": "1.3.3-beta.0", "description": "Framework-agnostic widget shell for agent-devtools — closed Shadow DOM mount, composer, picker overlay, SSE transport", "keywords": [ "agent-devtools",