#87 Docker Agent : refuser serve acp sans fichier d'agent, expliquer « accepts 1 arg(s), received 0 »
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
653ef94 parent: a67301e modified
.memory/history.md +1 -0 | @@ -229,3 +229,4 @@ | ||
| 229 | 229 | - **2026-11-10 — sbx program from agent:** (owner: "select the right program once the sbxenv.yaml is dropped or chosen, for codex, gemini and claude"): `withSbxProgram` in `withSandboxEnv` — agent: claude/codex/gemini sets program + arguments when the field is empty or holds a listed program; typed programs kept. Guides EN/FR step 5 updated; comments on #81/#82/#84 (Gemini verified on the Mac). New ticket #86 Mistral Vibe in sbx (no milestone). |
| 230 | 230 | - **2026-11-10 — same for mini-me** (owner: "the same for mini me"): `programOfSandbox` — agent: mini-me* (e.g. mini-me-kit) → mm --acp; a configuration file given before the sbxenv.yaml re-applies --config. mm stays outside sbxAgentOf (its config file is still asked, no note). Docs EN/FR: run-an-agent-in-a-sandbox, add-an-agent. |
| 231 | 231 | - **2026-11-10 — snippets mini-me-acp + #87 docker-agent in sbx** (owner: "add an example in agents/snippets, then create a ticket for docker agent too and implement it"): snippet mini-me-acp (kit docker.io/k33g/mini-me-kit:0.1.1, workspace/agent.yaml from milo's). #87: `programOfSandbox` agent docker-agent|cagent → docker-agent serve acp (built-in sbx agent, no kit: the v3 kit does not load while the built-in exists); snippet docker-agent-acp (agent.yaml with anthropic/claude-sonnet-4-5, key via sbx secret). No milestone on #87. Not tried with sbx. |
| 232 | +- **2026-11-10 — #87 on the Mac**: sandbox created (sbx resolves agent: docker-agent to the kit docker.io/sbx/docker-agent), but `serve acp` without the agent file → "accepts 1 arg(s), received 0". Assistant now refuses docker-agent serve acp without a file (Missing 'agentFile'); errors.ts explains the message. | |
| @@ -229,3 +229,4 @@ | |||
| 229 | - **2026-11-10 — sbx program from agent:** (owner: "select the right program once the sbxenv.yaml is dropped or chosen, for codex, gemini and claude"): `withSbxProgram` in `withSandboxEnv` — agent: claude/codex/gemini sets program + arguments when the field is empty or holds a listed program; typed programs kept. Guides EN/FR step 5 updated; comments on #81/#82/#84 (Gemini verified on the Mac). New ticket #86 Mistral Vibe in sbx (no milestone). | 229 | - **2026-11-10 — sbx program from agent:** (owner: "select the right program once the sbxenv.yaml is dropped or chosen, for codex, gemini and claude"): `withSbxProgram` in `withSandboxEnv` — agent: claude/codex/gemini sets program + arguments when the field is empty or holds a listed program; typed programs kept. Guides EN/FR step 5 updated; comments on #81/#82/#84 (Gemini verified on the Mac). New ticket #86 Mistral Vibe in sbx (no milestone). |
| 230 | - **2026-11-10 — same for mini-me** (owner: "the same for mini me"): `programOfSandbox` — agent: mini-me* (e.g. mini-me-kit) → mm --acp; a configuration file given before the sbxenv.yaml re-applies --config. mm stays outside sbxAgentOf (its config file is still asked, no note). Docs EN/FR: run-an-agent-in-a-sandbox, add-an-agent. | 230 | - **2026-11-10 — same for mini-me** (owner: "the same for mini me"): `programOfSandbox` — agent: mini-me* (e.g. mini-me-kit) → mm --acp; a configuration file given before the sbxenv.yaml re-applies --config. mm stays outside sbxAgentOf (its config file is still asked, no note). Docs EN/FR: run-an-agent-in-a-sandbox, add-an-agent. |
| 231 | - **2026-11-10 — snippets mini-me-acp + #87 docker-agent in sbx** (owner: "add an example in agents/snippets, then create a ticket for docker agent too and implement it"): snippet mini-me-acp (kit docker.io/k33g/mini-me-kit:0.1.1, workspace/agent.yaml from milo's). #87: `programOfSandbox` agent docker-agent|cagent → docker-agent serve acp (built-in sbx agent, no kit: the v3 kit does not load while the built-in exists); snippet docker-agent-acp (agent.yaml with anthropic/claude-sonnet-4-5, key via sbx secret). No milestone on #87. Not tried with sbx. | 231 | - **2026-11-10 — snippets mini-me-acp + #87 docker-agent in sbx** (owner: "add an example in agents/snippets, then create a ticket for docker agent too and implement it"): snippet mini-me-acp (kit docker.io/k33g/mini-me-kit:0.1.1, workspace/agent.yaml from milo's). #87: `programOfSandbox` agent docker-agent|cagent → docker-agent serve acp (built-in sbx agent, no kit: the v3 kit does not load while the built-in exists); snippet docker-agent-acp (agent.yaml with anthropic/claude-sonnet-4-5, key via sbx secret). No milestone on #87. Not tried with sbx. |
| 232 | +- **2026-11-10 — #87 on the Mac**: sandbox created (sbx resolves agent: docker-agent to the kit docker.io/sbx/docker-agent), but `serve acp` without the agent file → "accepts 1 arg(s), received 0". Assistant now refuses docker-agent serve acp without a file (Missing 'agentFile'); errors.ts explains the message. | ||
modified
.tickets/issues/0087-simplifier-l-ajout-d-une-sbx-avec-docker-agent.yaml +11 -1 | @@ -6,7 +6,7 @@ author: | ||
| 6 | 6 | name: k33g |
| 7 | 7 | email: ph.charriere@gmail.com |
| 8 | 8 | createdAt: 2026-11-10T05:40:48.000Z |
| 9 | -updatedAt: 2026-11-10T05:40:48.000Z | |
| 9 | +updatedAt: 2026-11-10T05:54:51.000Z | |
| 10 | 10 | labels: |
| 11 | 11 | - kind::feature |
| 12 | 12 | - area::config |
| @@ -79,3 +79,13 @@ comments: | ||
| 79 | 79 | et [agents/snippets/mini-me-acp](agents/snippets/mini-me-acp/README.md). |
| 80 | 80 | - Docs EN + FR : « Lancer un agent dans une sandbox sbx », « Ajouter un agent ». |
| 81 | 81 | - Non vérifié : démarrage réel dans sbx (pas de sbx ici). |
| 82 | + - id: 2 | |
| 83 | + author: | |
| 84 | + name: k33g | |
| 85 | + email: ph.charriere@gmail.com | |
| 86 | + createdAt: 2026-11-10T05:54:51.000Z | |
| 87 | + body: | | |
| 88 | + Essayé sur le Mac : la sandbox est créée (sbx résout `agent: docker-agent` vers le kit `docker.io/sbx/docker-agent`), | |
| 89 | + mais l'agent s'arrête avec « Error: accepts 1 arg(s), received 0 » : l'entrée avait `serve acp` sans le fichier d'agent. | |
| 90 | + L'assistant refuse maintenant `docker-agent serve acp` sans fichier (problème `agentFile` dans `problemsOf`), et le | |
| 91 | + message d'erreur est expliqué (`error.agentFileMissing`). Doc EN + FR : la variante dans « Lancer un agent dans une sandbox sbx ». | |
| @@ -6,7 +6,7 @@ author: | |||
| 6 | name: k33g | 6 | name: k33g |
| 7 | email: ph.charriere@gmail.com | 7 | email: ph.charriere@gmail.com |
| 8 | createdAt: 2026-11-10T05:40:48.000Z | 8 | createdAt: 2026-11-10T05:40:48.000Z |
| 9 | -updatedAt: 2026-11-10T05:40:48.000Z | 9 | +updatedAt: 2026-11-10T05:54:51.000Z |
| 10 | labels: | 10 | labels: |
| 11 | - kind::feature | 11 | - kind::feature |
| 12 | - area::config | 12 | - area::config |
| @@ -79,3 +79,13 @@ comments: | |||
| 79 | et [agents/snippets/mini-me-acp](agents/snippets/mini-me-acp/README.md). | 79 | et [agents/snippets/mini-me-acp](agents/snippets/mini-me-acp/README.md). |
| 80 | - Docs EN + FR : « Lancer un agent dans une sandbox sbx », « Ajouter un agent ». | 80 | - Docs EN + FR : « Lancer un agent dans une sandbox sbx », « Ajouter un agent ». |
| 81 | - Non vérifié : démarrage réel dans sbx (pas de sbx ici). | 81 | - Non vérifié : démarrage réel dans sbx (pas de sbx ici). |
| 82 | + - id: 2 | ||
| 83 | + author: | ||
| 84 | + name: k33g | ||
| 85 | + email: ph.charriere@gmail.com | ||
| 86 | + createdAt: 2026-11-10T05:54:51.000Z | ||
| 87 | + body: | | ||
| 88 | + Essayé sur le Mac : la sandbox est créée (sbx résout `agent: docker-agent` vers le kit `docker.io/sbx/docker-agent`), | ||
| 89 | + mais l'agent s'arrête avec « Error: accepts 1 arg(s), received 0 » : l'entrée avait `serve acp` sans le fichier d'agent. | ||
| 90 | + L'assistant refuse maintenant `docker-agent serve acp` sans fichier (problème `agentFile` dans `problemsOf`), et le | ||
| 91 | + message d'erreur est expliqué (`error.agentFileMissing`). Doc EN + FR : la variante dans « Lancer un agent dans une sandbox sbx ». | ||
modified
docs/en/how-to/run-an-agent-in-a-sandbox.md +1 -0 | @@ -64,6 +64,7 @@ The **■ Stop the sandbox** and **🗑 Remove the sandbox** buttons appear in t | ||
| 64 | 64 | - **The sandbox name is not the `name:` of the sbxenv.yaml**: after `create`, Sidekicks still finds no sandbox and says so. Make `sandbox` and `name:` the same. |
| 65 | 65 | - **Sidekicks opened from the Finder**: it may not find `sbx` in its short `PATH`. Write its full path (`command: /usr/local/bin/sbx`, see `which sbx`) or add `env: {PATH: "…"}` to the agent. |
| 66 | 66 | - **The model server runs on this computer**: from inside the sandbox, reach it through `host.docker.internal`, as from a container. |
| 67 | +- **Docker Agent stops with `Error: accepts 1 arg(s), received 0`**: it was started with `serve acp` but no agent file. Add the file's path after `serve acp` in its `args` (the assistant now refuses to add it without one). | |
| 67 | 68 | - **Another program than mm** (docker-agent, for instance): only `args` change, e.g. `[exec, -i, my-sandbox, docker-agent, serve, acp, /path/to/agent.yaml]`. For Claude, Codex or Gemini, see [How to add a Claude agent in an sbx sandbox](add-a-claude-agent-in-a-sandbox.md), [a Codex agent](add-a-codex-agent-in-a-sandbox.md) or [a Gemini agent](add-a-gemini-agent-in-a-sandbox.md). |
| 68 | 69 | - **Check without Sidekicks**: `sbx exec -it <sandbox> bash` opens the same kind of shell as the Terminal tab. |
| 69 | 70 | |
| @@ -64,6 +64,7 @@ The **■ Stop the sandbox** and **🗑 Remove the sandbox** buttons appear in t | |||
| 64 | - **The sandbox name is not the `name:` of the sbxenv.yaml**: after `create`, Sidekicks still finds no sandbox and says so. Make `sandbox` and `name:` the same. | 64 | - **The sandbox name is not the `name:` of the sbxenv.yaml**: after `create`, Sidekicks still finds no sandbox and says so. Make `sandbox` and `name:` the same. |
| 65 | - **Sidekicks opened from the Finder**: it may not find `sbx` in its short `PATH`. Write its full path (`command: /usr/local/bin/sbx`, see `which sbx`) or add `env: {PATH: "…"}` to the agent. | 65 | - **Sidekicks opened from the Finder**: it may not find `sbx` in its short `PATH`. Write its full path (`command: /usr/local/bin/sbx`, see `which sbx`) or add `env: {PATH: "…"}` to the agent. |
| 66 | - **The model server runs on this computer**: from inside the sandbox, reach it through `host.docker.internal`, as from a container. | 66 | - **The model server runs on this computer**: from inside the sandbox, reach it through `host.docker.internal`, as from a container. |
| 67 | +- **Docker Agent stops with `Error: accepts 1 arg(s), received 0`**: it was started with `serve acp` but no agent file. Add the file's path after `serve acp` in its `args` (the assistant now refuses to add it without one). | ||
| 67 | - **Another program than mm** (docker-agent, for instance): only `args` change, e.g. `[exec, -i, my-sandbox, docker-agent, serve, acp, /path/to/agent.yaml]`. For Claude, Codex or Gemini, see [How to add a Claude agent in an sbx sandbox](add-a-claude-agent-in-a-sandbox.md), [a Codex agent](add-a-codex-agent-in-a-sandbox.md) or [a Gemini agent](add-a-gemini-agent-in-a-sandbox.md). | 68 | - **Another program than mm** (docker-agent, for instance): only `args` change, e.g. `[exec, -i, my-sandbox, docker-agent, serve, acp, /path/to/agent.yaml]`. For Claude, Codex or Gemini, see [How to add a Claude agent in an sbx sandbox](add-a-claude-agent-in-a-sandbox.md), [a Codex agent](add-a-codex-agent-in-a-sandbox.md) or [a Gemini agent](add-a-gemini-agent-in-a-sandbox.md). |
| 68 | - **Check without Sidekicks**: `sbx exec -it <sandbox> bash` opens the same kind of shell as the Terminal tab. | 69 | - **Check without Sidekicks**: `sbx exec -it <sandbox> bash` opens the same kind of shell as the Terminal tab. |
| 69 | 70 | ||
modified
docs/fr/how-to/lancer-un-agent-dans-une-sandbox.md +1 -0 | @@ -64,6 +64,7 @@ Les boutons **■ Arrêter la sandbox** et **🗑 Supprimer la sandbox** apparai | ||
| 64 | 64 | - **Le nom de la sandbox n'est pas le `name:` du sbxenv.yaml** : après `create`, Sidekicks ne trouve toujours pas de sandbox et le dit. Donnez la même valeur à `sandbox` et à `name:`. |
| 65 | 65 | - **Sidekicks lancé depuis le Finder** : il peut ne pas trouver `sbx` dans son `PATH` réduit. Écrivez son chemin complet (`command: /usr/local/bin/sbx`, voir `which sbx`) ou ajoutez `env: {PATH: "…"}` à l'agent. |
| 66 | 66 | - **Le serveur de modèles tourne sur cet ordinateur** : depuis la sandbox, atteignez-le par `host.docker.internal`, comme depuis un conteneur. |
| 67 | +- **Docker Agent s'arrête avec `Error: accepts 1 arg(s), received 0`** : il a été démarré avec `serve acp` mais sans fichier d'agent. Ajoutez le chemin du fichier après `serve acp` dans ses `args` (l'assistant refuse désormais de l'ajouter sans). | |
| 67 | 68 | - **Un autre programme que mm** (docker-agent, par exemple) : seuls les `args` changent, par exemple `[exec, -i, ma-sandbox, docker-agent, serve, acp, /chemin/vers/agent.yaml]`. Pour Claude, Codex ou Gemini, voir [Ajouter un agent Claude dans une sandbox sbx](ajouter-un-agent-claude-dans-une-sandbox.md), [un agent Codex](ajouter-un-agent-codex-dans-une-sandbox.md) ou [un agent Gemini](ajouter-un-agent-gemini-dans-une-sandbox.md). |
| 68 | 69 | - **Vérifier sans Sidekicks** : `sbx exec -it <sandbox> bash` ouvre le même genre de shell que l'onglet Terminal. |
| 69 | 70 | |
| @@ -64,6 +64,7 @@ Les boutons **■ Arrêter la sandbox** et **🗑 Supprimer la sandbox** apparai | |||
| 64 | - **Le nom de la sandbox n'est pas le `name:` du sbxenv.yaml** : après `create`, Sidekicks ne trouve toujours pas de sandbox et le dit. Donnez la même valeur à `sandbox` et à `name:`. | 64 | - **Le nom de la sandbox n'est pas le `name:` du sbxenv.yaml** : après `create`, Sidekicks ne trouve toujours pas de sandbox et le dit. Donnez la même valeur à `sandbox` et à `name:`. |
| 65 | - **Sidekicks lancé depuis le Finder** : il peut ne pas trouver `sbx` dans son `PATH` réduit. Écrivez son chemin complet (`command: /usr/local/bin/sbx`, voir `which sbx`) ou ajoutez `env: {PATH: "…"}` à l'agent. | 65 | - **Sidekicks lancé depuis le Finder** : il peut ne pas trouver `sbx` dans son `PATH` réduit. Écrivez son chemin complet (`command: /usr/local/bin/sbx`, voir `which sbx`) ou ajoutez `env: {PATH: "…"}` à l'agent. |
| 66 | - **Le serveur de modèles tourne sur cet ordinateur** : depuis la sandbox, atteignez-le par `host.docker.internal`, comme depuis un conteneur. | 66 | - **Le serveur de modèles tourne sur cet ordinateur** : depuis la sandbox, atteignez-le par `host.docker.internal`, comme depuis un conteneur. |
| 67 | +- **Docker Agent s'arrête avec `Error: accepts 1 arg(s), received 0`** : il a été démarré avec `serve acp` mais sans fichier d'agent. Ajoutez le chemin du fichier après `serve acp` dans ses `args` (l'assistant refuse désormais de l'ajouter sans). | ||
| 67 | - **Un autre programme que mm** (docker-agent, par exemple) : seuls les `args` changent, par exemple `[exec, -i, ma-sandbox, docker-agent, serve, acp, /chemin/vers/agent.yaml]`. Pour Claude, Codex ou Gemini, voir [Ajouter un agent Claude dans une sandbox sbx](ajouter-un-agent-claude-dans-une-sandbox.md), [un agent Codex](ajouter-un-agent-codex-dans-une-sandbox.md) ou [un agent Gemini](ajouter-un-agent-gemini-dans-une-sandbox.md). | 68 | - **Un autre programme que mm** (docker-agent, par exemple) : seuls les `args` changent, par exemple `[exec, -i, ma-sandbox, docker-agent, serve, acp, /chemin/vers/agent.yaml]`. Pour Claude, Codex ou Gemini, voir [Ajouter un agent Claude dans une sandbox sbx](ajouter-un-agent-claude-dans-une-sandbox.md), [un agent Codex](ajouter-un-agent-codex-dans-une-sandbox.md) ou [un agent Gemini](ajouter-un-agent-gemini-dans-une-sandbox.md). |
| 68 | - **Vérifier sans Sidekicks** : `sbx exec -it <sandbox> bash` ouvre le même genre de shell que l'onglet Terminal. | 69 | - **Vérifier sans Sidekicks** : `sbx exec -it <sandbox> bash` ouvre le même genre de shell que l'onglet Terminal. |
| 69 | 70 | ||
modified
frontend/src/lib/agent/AddAgentForm.svelte +2 -1 | @@ -312,7 +312,8 @@ | ||
| 312 | 312 | </div> |
| 313 | 313 | <label> |
| 314 | 314 | {t('assistant.arguments')} |
| 315 | - <input bind:value={form.arguments} placeholder={t('assistant.argumentsPlaceholder')} spellcheck="false" autocapitalize="off" /> | |
| 315 | + <input bind:value={form.arguments} placeholder={t('assistant.argumentsPlaceholder')} aria-invalid={has('agentFile')} spellcheck="false" autocapitalize="off" /> | |
| 316 | + {#if has('agentFile')}<small class="problem" role="alert">{t('assistant.missing.agentFile')}</small>{/if} | |
| 316 | 317 | </label> |
| 317 | 318 | <label for="workspace">{t('assistant.workspace')}</label> |
| 318 | 319 | <div class="row centered"> |
| @@ -312,7 +312,8 @@ | |||
| 312 | </div> | 312 | </div> |
| 313 | <label> | 313 | <label> |
| 314 | {t('assistant.arguments')} | 314 | {t('assistant.arguments')} |
| 315 | - <input bind:value={form.arguments} placeholder={t('assistant.argumentsPlaceholder')} spellcheck="false" autocapitalize="off" /> | 315 | + <input bind:value={form.arguments} placeholder={t('assistant.argumentsPlaceholder')} aria-invalid={has('agentFile')} spellcheck="false" autocapitalize="off" /> |
| 316 | + {#if has('agentFile')}<small class="problem" role="alert">{t('assistant.missing.agentFile')}</small>{/if} | ||
| 316 | </label> | 317 | </label> |
| 317 | <label for="workspace">{t('assistant.workspace')}</label> | 318 | <label for="workspace">{t('assistant.workspace')}</label> |
| 318 | <div class="row centered"> | 319 | <div class="row centered"> |
modified
frontend/src/lib/agentform.test.ts +11 -0 | @@ -196,3 +196,14 @@ describe('Docker Agent in a sandbox (issue #87)', () => { | ||
| 196 | 196 | expect(argumentsFor('docker-agent', '/a/agent.yaml')).toBe('serve acp /a/agent.yaml') |
| 197 | 197 | }) |
| 198 | 198 | }) |
| 199 | + | |
| 200 | +describe('Docker Agent without its agent file', () => { | |
| 201 | + const form = { ...emptyForm(), name: 'da', workspace: '/a', environment: 'sbx' as const, box: 'da-sbx', program: 'docker-agent', arguments: 'serve acp' } | |
| 202 | + it('is refused', () => { | |
| 203 | + expect(problemsOf(form)).toEqual(['agentFile']) | |
| 204 | + expect(problemsOf({ ...form, program: 'docker agent', arguments: ' serve acp ' })).toEqual(['agentFile']) | |
| 205 | + }) | |
| 206 | + it('is accepted with the file', () => { | |
| 207 | + expect(problemsOf({ ...form, arguments: 'serve acp /a/agent.yaml' })).toEqual([]) | |
| 208 | + }) | |
| 209 | +}) | |
| @@ -196,3 +196,14 @@ describe('Docker Agent in a sandbox (issue #87)', () => { | |||
| 196 | expect(argumentsFor('docker-agent', '/a/agent.yaml')).toBe('serve acp /a/agent.yaml') | 196 | expect(argumentsFor('docker-agent', '/a/agent.yaml')).toBe('serve acp /a/agent.yaml') |
| 197 | }) | 197 | }) |
| 198 | }) | 198 | }) |
| 199 | + | ||
| 200 | +describe('Docker Agent without its agent file', () => { | ||
| 201 | + const form = { ...emptyForm(), name: 'da', workspace: '/a', environment: 'sbx' as const, box: 'da-sbx', program: 'docker-agent', arguments: 'serve acp' } | ||
| 202 | + it('is refused', () => { | ||
| 203 | + expect(problemsOf(form)).toEqual(['agentFile']) | ||
| 204 | + expect(problemsOf({ ...form, program: 'docker agent', arguments: ' serve acp ' })).toEqual(['agentFile']) | ||
| 205 | + }) | ||
| 206 | + it('is accepted with the file', () => { | ||
| 207 | + expect(problemsOf({ ...form, arguments: 'serve acp /a/agent.yaml' })).toEqual([]) | ||
| 208 | + }) | ||
| 209 | +}) | ||
modified
frontend/src/lib/agentform.ts +5 -1 | @@ -88,13 +88,14 @@ export function nameFromTitle(title: string): string { | ||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** The fields the user still has to fill in, by name. */ |
| 91 | -export type Missing = 'name' | 'nameFormat' | 'program' | 'workspace' | 'box' | |
| 91 | +export type Missing = 'name' | 'nameFormat' | 'program' | 'workspace' | 'box' | 'agentFile' | |
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | 94 | * What is missing or wrong before the form can be sent. |
| 95 | 95 | * |
| 96 | 96 | * @example |
| 97 | 97 | * problemsOf({ ...emptyForm(), title: 'Alice' }) // ['name', 'program', 'workspace'] |
| 98 | + * problemsOf({ ...form, program: 'docker-agent', arguments: 'serve acp' }) // [… 'agentFile'] | |
| 98 | 99 | */ |
| 99 | 100 | export function problemsOf(form: AgentFormValues): Missing[] { |
| 100 | 101 | const problems: Missing[] = [] |
| @@ -104,6 +105,9 @@ export function problemsOf(form: AgentFormValues): Missing[] { | ||
| 104 | 105 | if (!form.program.trim()) problems.push('program') |
| 105 | 106 | if (!form.workspace.trim()) problems.push('workspace') |
| 106 | 107 | if (form.environment !== 'local' && !form.box.trim()) problems.push('box') |
| 108 | + // Docker Agent serves one agent file over ACP: "serve acp" alone stops at once. | |
| 109 | + const command = `${form.program} ${form.arguments}`.trim().split(/\s+/).join(' ') | |
| 110 | + if (/^docker[- ]agent serve acp$/.test(command)) problems.push('agentFile') | |
| 107 | 111 | return problems |
| 108 | 112 | } |
| 109 | 113 | |
| @@ -88,13 +88,14 @@ export function nameFromTitle(title: string): string { | |||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | /** The fields the user still has to fill in, by name. */ | 90 | /** The fields the user still has to fill in, by name. */ |
| 91 | -export type Missing = 'name' | 'nameFormat' | 'program' | 'workspace' | 'box' | 91 | +export type Missing = 'name' | 'nameFormat' | 'program' | 'workspace' | 'box' | 'agentFile' |
| 92 | 92 | ||
| 93 | /** | 93 | /** |
| 94 | * What is missing or wrong before the form can be sent. | 94 | * What is missing or wrong before the form can be sent. |
| 95 | * | 95 | * |
| 96 | * @example | 96 | * @example |
| 97 | * problemsOf({ ...emptyForm(), title: 'Alice' }) // ['name', 'program', 'workspace'] | 97 | * problemsOf({ ...emptyForm(), title: 'Alice' }) // ['name', 'program', 'workspace'] |
| 98 | + * problemsOf({ ...form, program: 'docker-agent', arguments: 'serve acp' }) // [… 'agentFile'] | ||
| 98 | */ | 99 | */ |
| 99 | export function problemsOf(form: AgentFormValues): Missing[] { | 100 | export function problemsOf(form: AgentFormValues): Missing[] { |
| 100 | const problems: Missing[] = [] | 101 | const problems: Missing[] = [] |
| @@ -104,6 +105,9 @@ export function problemsOf(form: AgentFormValues): Missing[] { | |||
| 104 | if (!form.program.trim()) problems.push('program') | 105 | if (!form.program.trim()) problems.push('program') |
| 105 | if (!form.workspace.trim()) problems.push('workspace') | 106 | if (!form.workspace.trim()) problems.push('workspace') |
| 106 | if (form.environment !== 'local' && !form.box.trim()) problems.push('box') | 107 | if (form.environment !== 'local' && !form.box.trim()) problems.push('box') |
| 108 | + // Docker Agent serves one agent file over ACP: "serve acp" alone stops at once. | ||
| 109 | + const command = `${form.program} ${form.arguments}`.trim().split(/\s+/).join(' ') | ||
| 110 | + if (/^docker[- ]agent serve acp$/.test(command)) problems.push('agentFile') | ||
| 107 | return problems | 111 | return problems |
| 108 | } | 112 | } |
| 109 | 113 | ||
modified
frontend/src/lib/errors.test.ts +1 -0 | @@ -15,6 +15,7 @@ describe('explain', () => { | ||
| 15 | 15 | expect(explain('Error response from daemon: container 4f2 is not running')).toEqual({ key: 'error.containerStopped', vars: { box: '4f2' } }) |
| 16 | 16 | expect(explain('the agent stopped: exit status 1\nCannot connect to the Docker daemon at unix:///var/run/docker.sock')).toEqual({ key: 'error.dockerNotRunning', vars: {} }) |
| 17 | 17 | expect(explain('sandbox "milo-sbx" not found')).toEqual({ key: 'error.sandboxMissing', vars: { box: 'milo-sbx' } }) |
| 18 | + expect(explain('docker-agent: self-update failed\nError: accepts 1 arg(s), received 0')).toEqual({ key: 'error.agentFileMissing', vars: {} }) | |
| 18 | 19 | }) |
| 19 | 20 | |
| 20 | 21 | it('recognises the limit of running agents', () => { |
| @@ -15,6 +15,7 @@ describe('explain', () => { | |||
| 15 | expect(explain('Error response from daemon: container 4f2 is not running')).toEqual({ key: 'error.containerStopped', vars: { box: '4f2' } }) | 15 | expect(explain('Error response from daemon: container 4f2 is not running')).toEqual({ key: 'error.containerStopped', vars: { box: '4f2' } }) |
| 16 | expect(explain('the agent stopped: exit status 1\nCannot connect to the Docker daemon at unix:///var/run/docker.sock')).toEqual({ key: 'error.dockerNotRunning', vars: {} }) | 16 | expect(explain('the agent stopped: exit status 1\nCannot connect to the Docker daemon at unix:///var/run/docker.sock')).toEqual({ key: 'error.dockerNotRunning', vars: {} }) |
| 17 | expect(explain('sandbox "milo-sbx" not found')).toEqual({ key: 'error.sandboxMissing', vars: { box: 'milo-sbx' } }) | 17 | expect(explain('sandbox "milo-sbx" not found')).toEqual({ key: 'error.sandboxMissing', vars: { box: 'milo-sbx' } }) |
| 18 | + expect(explain('docker-agent: self-update failed\nError: accepts 1 arg(s), received 0')).toEqual({ key: 'error.agentFileMissing', vars: {} }) | ||
| 18 | }) | 19 | }) |
| 19 | 20 | ||
| 20 | it('recognises the limit of running agents', () => { | 21 | it('recognises the limit of running agents', () => { |
modified
frontend/src/lib/errors.ts +2 -0 | @@ -23,6 +23,8 @@ interface Rule { | ||
| 23 | 23 | const rules: Rule[] = [ |
| 24 | 24 | { pattern: /Cannot connect to the Docker daemon|docker daemon is not running|error during connect/i, key: 'error.dockerNotRunning' }, |
| 25 | 25 | { pattern: /No such container:\s*(\S+)/i, key: 'error.containerMissing', groups: ['box'] }, |
| 26 | + // docker-agent serve acp without its agent file (cobra's message). | |
| 27 | + { pattern: /accepts 1 arg\(s\), received 0/, key: 'error.agentFileMissing' }, | |
| 26 | 28 | { pattern: /container (\S+) is not running|Container (\S+) is not running/i, key: 'error.containerStopped', groups: ['box'] }, |
| 27 | 29 | { pattern: /sandbox[ "']+([\w.-]+)["']? (?:not found|does not exist)/i, key: 'error.sandboxMissing', groups: ['box'] }, |
| 28 | 30 | { pattern: /exec: "([^"]+)": executable file not found/, key: 'error.programNotFound', groups: ['program'] }, |
| @@ -23,6 +23,8 @@ interface Rule { | |||
| 23 | const rules: Rule[] = [ | 23 | const rules: Rule[] = [ |
| 24 | { pattern: /Cannot connect to the Docker daemon|docker daemon is not running|error during connect/i, key: 'error.dockerNotRunning' }, | 24 | { pattern: /Cannot connect to the Docker daemon|docker daemon is not running|error during connect/i, key: 'error.dockerNotRunning' }, |
| 25 | { pattern: /No such container:\s*(\S+)/i, key: 'error.containerMissing', groups: ['box'] }, | 25 | { pattern: /No such container:\s*(\S+)/i, key: 'error.containerMissing', groups: ['box'] }, |
| 26 | + // docker-agent serve acp without its agent file (cobra's message). | ||
| 27 | + { pattern: /accepts 1 arg\(s\), received 0/, key: 'error.agentFileMissing' }, | ||
| 26 | { pattern: /container (\S+) is not running|Container (\S+) is not running/i, key: 'error.containerStopped', groups: ['box'] }, | 28 | { pattern: /container (\S+) is not running|Container (\S+) is not running/i, key: 'error.containerStopped', groups: ['box'] }, |
| 27 | { pattern: /sandbox[ "']+([\w.-]+)["']? (?:not found|does not exist)/i, key: 'error.sandboxMissing', groups: ['box'] }, | 29 | { pattern: /sandbox[ "']+([\w.-]+)["']? (?:not found|does not exist)/i, key: 'error.sandboxMissing', groups: ['box'] }, |
| 28 | { pattern: /exec: "([^"]+)": executable file not found/, key: 'error.programNotFound', groups: ['program'] }, | 30 | { pattern: /exec: "([^"]+)": executable file not found/, key: 'error.programNotFound', groups: ['program'] }, |
modified
frontend/src/lib/i18n/messages.ts +4 -0 | @@ -162,6 +162,7 @@ export const en = { | ||
| 162 | 162 | 'error.containerMissing': 'The container "{box}" does not exist. Create and start it (docker run …), or correct its name in the agent\'s settings.', |
| 163 | 163 | 'error.containerStopped': 'The container "{box}" is stopped. Start it with: docker start {box}', |
| 164 | 164 | 'error.sandboxMissing': 'The sbx sandbox "{box}" does not exist. Create it, or correct its name in the agent\'s settings.', |
| 165 | + 'error.agentFileMissing': 'The agent was started without its file: Docker Agent needs the path of its agent file after serve acp. Add it to the agent\'s arguments in Settings.', | |
| 165 | 166 | 'error.limitReached': 'Already {limit} agents are working, the most allowed at once. Wait for one to finish, or stop one in the Agents panel.', |
| 166 | 167 | 'error.modelServer': 'The agent cannot reach its model server. Check that it is running (llmman, Ollama…), then try again.', |
| 167 | 168 | 'error.protocol': 'This agent speaks a version of ACP that Sidekicks does not know. Update the agent or Sidekicks.', |
| @@ -376,6 +377,7 @@ export const en = { | ||
| 376 | 377 | 'assistant.missing.program': 'Say which program starts the agent.', |
| 377 | 378 | 'assistant.missing.workspace': 'Choose the agent\'s folder.', |
| 378 | 379 | 'assistant.missing.box': 'Give the name of the container or sandbox.', |
| 380 | + 'assistant.missing.agentFile': 'Docker Agent needs its agent file after serve acp: drop it on the agent\'s configuration file area above, or type its path.', | |
| 379 | 381 | 'assistant.refused': 'The agent was not added:', |
| 380 | 382 | 'assistant.agentConfig.title': 'The agent\'s configuration file (optional)', |
| 381 | 383 | 'assistant.agentConfig.intro': 'Give the YAML file that configures the agent: its folder becomes the agent\'s folder, and the arguments of mm, docker-agent or docker agent are filled in.', |
| @@ -554,6 +556,7 @@ export const fr: Record<MessageKey, string> = { | ||
| 554 | 556 | 'error.containerMissing': "Le conteneur « {box} » n'existe pas. Créez-le et démarrez-le (docker run …), ou corrigez son nom dans les réglages de l'agent.", |
| 555 | 557 | 'error.containerStopped': 'Le conteneur « {box} » est arrêté. Démarrez-le avec : docker start {box}', |
| 556 | 558 | 'error.sandboxMissing': "La sandbox sbx « {box} » n'existe pas. Créez-la, ou corrigez son nom dans les réglages de l'agent.", |
| 559 | + 'error.agentFileMissing': "L'agent a été démarré sans son fichier : Docker Agent a besoin du chemin de son fichier d'agent après serve acp. Ajoutez-le aux arguments de l'agent dans Settings.", | |
| 557 | 560 | 'error.limitReached': "Déjà {limit} agents travaillent, le maximum autorisé en même temps. Attendez qu'un agent ait fini, ou arrêtez-en un dans le panneau Agents.", |
| 558 | 561 | 'error.modelServer': "L'agent n'arrive pas à joindre son serveur de modèles. Vérifiez qu'il tourne (llmman, Ollama…), puis réessayez.", |
| 559 | 562 | 'error.protocol': "Cet agent parle une version d'ACP que Sidekicks ne connaît pas. Mettez à jour l'agent ou Sidekicks.", |
| @@ -766,6 +769,7 @@ export const fr: Record<MessageKey, string> = { | ||
| 766 | 769 | 'assistant.missing.program': "Indiquez le programme qui démarre l'agent.", |
| 767 | 770 | 'assistant.missing.workspace': "Choisissez le dossier de l'agent.", |
| 768 | 771 | 'assistant.missing.box': 'Donnez le nom du conteneur ou de la sandbox.', |
| 772 | + 'assistant.missing.agentFile': "Docker Agent a besoin de son fichier d'agent après serve acp : déposez-le plus haut sur la zone du fichier de configuration de l'agent, ou tapez son chemin.", | |
| 769 | 773 | 'assistant.refused': "L'agent n'a pas été ajouté :", |
| 770 | 774 | 'assistant.agentConfig.title': "Le fichier de configuration de l'agent (facultatif)", |
| 771 | 775 | 'assistant.agentConfig.intro': "Indiquez le fichier YAML qui configure l'agent : son dossier devient celui de l'agent, et les arguments de mm, docker-agent ou docker agent sont remplis.", |
| @@ -162,6 +162,7 @@ export const en = { | |||
| 162 | 'error.containerMissing': 'The container "{box}" does not exist. Create and start it (docker run …), or correct its name in the agent\'s settings.', | 162 | 'error.containerMissing': 'The container "{box}" does not exist. Create and start it (docker run …), or correct its name in the agent\'s settings.', |
| 163 | 'error.containerStopped': 'The container "{box}" is stopped. Start it with: docker start {box}', | 163 | 'error.containerStopped': 'The container "{box}" is stopped. Start it with: docker start {box}', |
| 164 | 'error.sandboxMissing': 'The sbx sandbox "{box}" does not exist. Create it, or correct its name in the agent\'s settings.', | 164 | 'error.sandboxMissing': 'The sbx sandbox "{box}" does not exist. Create it, or correct its name in the agent\'s settings.', |
| 165 | + 'error.agentFileMissing': 'The agent was started without its file: Docker Agent needs the path of its agent file after serve acp. Add it to the agent\'s arguments in Settings.', | ||
| 165 | 'error.limitReached': 'Already {limit} agents are working, the most allowed at once. Wait for one to finish, or stop one in the Agents panel.', | 166 | 'error.limitReached': 'Already {limit} agents are working, the most allowed at once. Wait for one to finish, or stop one in the Agents panel.', |
| 166 | 'error.modelServer': 'The agent cannot reach its model server. Check that it is running (llmman, Ollama…), then try again.', | 167 | 'error.modelServer': 'The agent cannot reach its model server. Check that it is running (llmman, Ollama…), then try again.', |
| 167 | 'error.protocol': 'This agent speaks a version of ACP that Sidekicks does not know. Update the agent or Sidekicks.', | 168 | 'error.protocol': 'This agent speaks a version of ACP that Sidekicks does not know. Update the agent or Sidekicks.', |
| @@ -376,6 +377,7 @@ export const en = { | |||
| 376 | 'assistant.missing.program': 'Say which program starts the agent.', | 377 | 'assistant.missing.program': 'Say which program starts the agent.', |
| 377 | 'assistant.missing.workspace': 'Choose the agent\'s folder.', | 378 | 'assistant.missing.workspace': 'Choose the agent\'s folder.', |
| 378 | 'assistant.missing.box': 'Give the name of the container or sandbox.', | 379 | 'assistant.missing.box': 'Give the name of the container or sandbox.', |
| 380 | + 'assistant.missing.agentFile': 'Docker Agent needs its agent file after serve acp: drop it on the agent\'s configuration file area above, or type its path.', | ||
| 379 | 'assistant.refused': 'The agent was not added:', | 381 | 'assistant.refused': 'The agent was not added:', |
| 380 | 'assistant.agentConfig.title': 'The agent\'s configuration file (optional)', | 382 | 'assistant.agentConfig.title': 'The agent\'s configuration file (optional)', |
| 381 | 'assistant.agentConfig.intro': 'Give the YAML file that configures the agent: its folder becomes the agent\'s folder, and the arguments of mm, docker-agent or docker agent are filled in.', | 383 | 'assistant.agentConfig.intro': 'Give the YAML file that configures the agent: its folder becomes the agent\'s folder, and the arguments of mm, docker-agent or docker agent are filled in.', |
| @@ -554,6 +556,7 @@ export const fr: Record<MessageKey, string> = { | |||
| 554 | 'error.containerMissing': "Le conteneur « {box} » n'existe pas. Créez-le et démarrez-le (docker run …), ou corrigez son nom dans les réglages de l'agent.", | 556 | 'error.containerMissing': "Le conteneur « {box} » n'existe pas. Créez-le et démarrez-le (docker run …), ou corrigez son nom dans les réglages de l'agent.", |
| 555 | 'error.containerStopped': 'Le conteneur « {box} » est arrêté. Démarrez-le avec : docker start {box}', | 557 | 'error.containerStopped': 'Le conteneur « {box} » est arrêté. Démarrez-le avec : docker start {box}', |
| 556 | 'error.sandboxMissing': "La sandbox sbx « {box} » n'existe pas. Créez-la, ou corrigez son nom dans les réglages de l'agent.", | 558 | 'error.sandboxMissing': "La sandbox sbx « {box} » n'existe pas. Créez-la, ou corrigez son nom dans les réglages de l'agent.", |
| 559 | + 'error.agentFileMissing': "L'agent a été démarré sans son fichier : Docker Agent a besoin du chemin de son fichier d'agent après serve acp. Ajoutez-le aux arguments de l'agent dans Settings.", | ||
| 557 | 'error.limitReached': "Déjà {limit} agents travaillent, le maximum autorisé en même temps. Attendez qu'un agent ait fini, ou arrêtez-en un dans le panneau Agents.", | 560 | 'error.limitReached': "Déjà {limit} agents travaillent, le maximum autorisé en même temps. Attendez qu'un agent ait fini, ou arrêtez-en un dans le panneau Agents.", |
| 558 | 'error.modelServer': "L'agent n'arrive pas à joindre son serveur de modèles. Vérifiez qu'il tourne (llmman, Ollama…), puis réessayez.", | 561 | 'error.modelServer': "L'agent n'arrive pas à joindre son serveur de modèles. Vérifiez qu'il tourne (llmman, Ollama…), puis réessayez.", |
| 559 | 'error.protocol': "Cet agent parle une version d'ACP que Sidekicks ne connaît pas. Mettez à jour l'agent ou Sidekicks.", | 562 | 'error.protocol': "Cet agent parle une version d'ACP que Sidekicks ne connaît pas. Mettez à jour l'agent ou Sidekicks.", |
| @@ -766,6 +769,7 @@ export const fr: Record<MessageKey, string> = { | |||
| 766 | 'assistant.missing.program': "Indiquez le programme qui démarre l'agent.", | 769 | 'assistant.missing.program': "Indiquez le programme qui démarre l'agent.", |
| 767 | 'assistant.missing.workspace': "Choisissez le dossier de l'agent.", | 770 | 'assistant.missing.workspace': "Choisissez le dossier de l'agent.", |
| 768 | 'assistant.missing.box': 'Donnez le nom du conteneur ou de la sandbox.', | 771 | 'assistant.missing.box': 'Donnez le nom du conteneur ou de la sandbox.', |
| 772 | + 'assistant.missing.agentFile': "Docker Agent a besoin de son fichier d'agent après serve acp : déposez-le plus haut sur la zone du fichier de configuration de l'agent, ou tapez son chemin.", | ||
| 769 | 'assistant.refused': "L'agent n'a pas été ajouté :", | 773 | 'assistant.refused': "L'agent n'a pas été ajouté :", |
| 770 | 'assistant.agentConfig.title': "Le fichier de configuration de l'agent (facultatif)", | 774 | 'assistant.agentConfig.title': "Le fichier de configuration de l'agent (facultatif)", |
| 771 | 'assistant.agentConfig.intro': "Indiquez le fichier YAML qui configure l'agent : son dossier devient celui de l'agent, et les arguments de mm, docker-agent ou docker agent sont remplis.", | 775 | 'assistant.agentConfig.intro': "Indiquez le fichier YAML qui configure l'agent : son dossier devient celui de l'agent, et les arguments de mm, docker-agent ou docker agent sont remplis.", |