merge(web): invalid node id custom CLI web mobile — #225 (QA verte)
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
---
|
||||
issueRef: "#219"
|
||||
version: 8
|
||||
version: 12
|
||||
updatedBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
updatedAt: 1786982821404
|
||||
updatedAt: 1787224101407
|
||||
---
|
||||
## Build AppImage 2026-08-15
|
||||
- Demande: rebuild de l'AppImage Linux après le fix Git Graph des tags annotés (#218).
|
||||
@ -34,7 +34,7 @@ updatedAt: 1786982821404
|
||||
|
||||
## Exécution 2026-08-17
|
||||
- Frontend: `npm --prefix frontend run build` => OK
|
||||
- Bundle Tauri AppImage essai 1: `CARGO_HOME=/tmp/idea-cargo-home APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=1 ../../frontend/node_modules/.bin/tauri build --bundles appimage` depuis `crates/app-tauri/` => ECHEC faute d'espace dans `/tmp`
|
||||
- Bundle Tauri essai 1: `CARGO_HOME=/tmp/idea-cargo-home APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=1 ../../frontend/node_modules/.bin/tauri build --bundles appimage` depuis `crates/app-tauri/` => ECHEC faute d'espace dans `/tmp`
|
||||
- Vérification espace: `df -h /tmp /home/anthony/Documents/Projects/IdeA` => `/tmp` à 100%, volume projet avec marge
|
||||
- Bundle Tauri essai 2: `CARGO_HOME=/home/anthony/Documents/Projects/IdeA/.appimage-build/cargo-home APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=1 ../../frontend/node_modules/.bin/tauri build --bundles appimage` depuis `crates/app-tauri/` => OK
|
||||
|
||||
@ -42,4 +42,16 @@ updatedAt: 1786982821404
|
||||
- `/home/anthony/Documents/Projects/IdeA/target/release/bundle/appimage/IdeA_0.3.0_amd64.AppImage`
|
||||
|
||||
## Rappel opérationnel 2026-08-17
|
||||
- Remplacement de l'AppImage installée et relance d'IdeA non effectués volontairement: opération manuelle pour éviter de tuer l'orchestrateur/session en cours.
|
||||
- Remplacement de l'AppImage installée et relance d'IdeA non effectués volontairement: opération manuelle pour éviter de tuer l'orchestrateur/session en cours.
|
||||
|
||||
## Build AppImage 2026-08-20
|
||||
- Demande: rebuild de l'AppImage Linux après le merge local du fix #224 sur la custom CLI web téléphone.
|
||||
- Workflow utilisé: skill `build-appimage`.
|
||||
- Frontend: `npm --prefix frontend run build` => OK.
|
||||
- Bundle Tauri AppImage: relancé directement avec `CARGO_HOME=/home/anthony/Documents/Projects/IdeA/.appimage-build/cargo-home APPIMAGE_EXTRACT_AND_RUN=1 NO_STRIP=1 ../../frontend/node_modules/.bin/tauri build --bundles appimage` depuis `crates/app-tauri/` pour éviter la rechute connue sur `/tmp` saturé => OK.
|
||||
- Commit buildé: `bd9f2cb` sur `develop`.
|
||||
- Artefact produit: `/home/anthony/Documents/Projects/IdeA/target/release/bundle/appimage/IdeA_0.3.0_amd64.AppImage`.
|
||||
- Tag Git local posé par Git apres build: `v0.16.0`.
|
||||
- Message du tag: `AppImage build 2026-08-20 on develop (bd9f2cb) — runtime node introuvable custom CLI téléphone #224 (QA verte)`.
|
||||
- Aucun push demandé/effectué; vérification Git: le tag reste strictement local.
|
||||
- Remplacement de l'AppImage installée et relance d'IdeA non effectués volontairement: opération manuelle pour ne pas tuer l'orchestrateur/session en cours.
|
||||
@ -11,7 +11,7 @@ attachments: []
|
||||
createdBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
updatedBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
createdAt: 1786817374873
|
||||
updatedAt: 1786982821404
|
||||
version: 8
|
||||
updatedAt: 1787224101407
|
||||
version: 12
|
||||
---
|
||||
Reconstruire l'AppImage Linux d'IdeA depuis l'état courant du dépôt après le correctif Git Graph des tags annotés, avec pose du tag de version local sur le commit buildé selon la règle projet. Aucun remplacement automatique de l'AppImage installée ni relance d'IdeA.
|
||||
Reconstruire l'AppImage Linux d'IdeA depuis l'état courant du dépôt après le fix #224 de la custom CLI web téléphone, avec pose du tag de version local sur le commit buildé selon la règle projet. Aucun remplacement automatique de l'AppImage installée ni relance d'IdeA.
|
||||
@ -1,8 +1,8 @@
|
||||
---
|
||||
issueRef: "#224"
|
||||
version: 14
|
||||
version: 16
|
||||
updatedBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
updatedAt: 1787222847970
|
||||
updatedAt: 1787223037400
|
||||
---
|
||||
2026-08-17 Main
|
||||
- Demande: permettre le passage en custom CLI sur la version web telephone avec une UI correctement adaptee aux telephones.
|
||||
@ -31,4 +31,8 @@ updatedAt: 1787222847970
|
||||
- Retour DevBackend: fix runtime implemente sans commit. `crates/application/src/agent/lifecycle.rs` fait maintenant reutiliser `mcp_server_wiring(...)` par `opencode_config_json` pour ecrire une commande MCP OpenCode basee sur le binaire IdeA (`idea-serve ... mcp-server`) quand un `McpRuntime` web est injecte, au lieu de dependre d'un `node` externe.
|
||||
- Preuve de test ajoutee par DevBackend: integration dans `crates/application/tests/agent_lifecycle.rs` garantissant qu'un lancement custom chat OpenCode avec runtime reste structured, n'ouvre aucun PTY, ecrit `opencode.json`, transmet `OPENCODE_CONFIG`, et que `mcp.idea.command[0] != "node"`.
|
||||
- Tests verts annonces par DevBackend: `cargo fmt`; `cargo test -p application opencode_config_json_with_runtime_uses_idea_exe_not_node -- --nocapture`; `cargo test -p application --test agent_lifecycle launch_opencode_chat_with_runtime_uses_idea_bridge_without_pty_or_node -- --nocapture`; `cargo test -p backend mcp_bridge -- --nocapture`; `cargo test -p web-server web_root_candidates_include_appimage_resource_dir -- --nocapture`; `cargo test -p web-server authorized_open_project_arms_orchestrator_watch -- --nocapture`; `npm test -- WebAgentCell.test.tsx`.
|
||||
- Note de reprise: un filtre large `cargo test -p application opencode -- --nocapture` remonte un echec existant non cible `p8c_opencode_same_pair_and_provider_are_isolated_by_project_root` (`left: 0 right: 2`), mais les non-regressions cibles du fix sont vertes separement.
|
||||
- Note de reprise: un filtre large `cargo test -p application opencode -- --nocapture` remonte un echec existant non cible `p8c_opencode_same_pair_and_provider_are_isolated_by_project_root` (`left: 0 right: 2`), mais les non-regressions cibles du fix sont vertes separement.
|
||||
- Validation QA finale du 2026-08-20: VERT sur commandes reelles. Preuves explicites: lancement structured conserve, pas de dependance `node` dans la commande MCP generee sous runtime web, et non-regression UI mobile verte.
|
||||
- Commandes QA finales: `cargo test -p application opencode_config_json_with_runtime_uses_idea_exe_not_node -- --nocapture`; `cargo test -p application --test agent_lifecycle launch_opencode_chat_with_runtime_uses_idea_bridge_without_pty_or_node -- --nocapture`; `cargo test -p backend mcp_bridge -- --nocapture`; `cargo test -p web-server web_root_candidates_include_appimage_resource_dir -- --nocapture`; `cargo test -p web-server authorized_open_project_arms_orchestrator_watch -- --nocapture`; `cd frontend && npm test -- --run src/features/web/WebAgentCell.test.tsx`.
|
||||
- Retour Git final: commit scope du fix `9a3ca51` sur `fix/224-web-custom-cli-node-runtime`, commit bookkeeping separe `b51a63f`, puis merge local `--no-ff` dans `develop` via `bd9f2cb`. Aucun push. Worktree final propre hors untracked non lies `.appimage-build/` et `scripts/restart-idea-over-ssh.sh`.
|
||||
- Statut final: ticket cloture le 2026-08-20 apres QA verte et merge local dans `develop`.
|
||||
@ -2,7 +2,7 @@
|
||||
id: "2be065b5-1859-4698-8c9e-7f1fc2c1f7a3"
|
||||
number: 224
|
||||
title: "Version web téléphone: permettre le passage en custom CLI avec UI mobile adaptée"
|
||||
status: "qa"
|
||||
status: "closed"
|
||||
priority: "high"
|
||||
sprint: null
|
||||
links: []
|
||||
@ -11,8 +11,8 @@ attachments: []
|
||||
createdBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
updatedBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
createdAt: 1786980793023
|
||||
updatedAt: 1787222847970
|
||||
version: 14
|
||||
updatedAt: 1787223037400
|
||||
version: 16
|
||||
---
|
||||
Regression du parcours version web téléphone -> custom CLI. Le jeudi 20 août 2026, l'utilisateur signale qu'en lançant la custom CLI depuis la version web téléphone, le runtime indique que `node` est introuvable. Avant tout correctif de production, la priorité est d'ajouter des tests de non-régression prouvant le bon démarrage des serveurs MCP dans ce parcours web/mobile, car cette zone a déjà régressé plusieurs fois.
|
||||
|
||||
|
||||
15
.ideai/tickets/225/carnet.md
Normal file
15
.ideai/tickets/225/carnet.md
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
issueRef: "#225"
|
||||
version: 6
|
||||
updatedBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
updatedAt: 1787224897257
|
||||
---
|
||||
2026-08-20 Main
|
||||
- Ticket créé suite au signalement utilisateur: erreur `invalid node id` persistante sur la version web mobile/téléphone avec custom CLI.
|
||||
- Pistes initiales locales: `frontend/src/features/web/WebAgentCell.tsx`, gateways de launch/attach custom CLI, validation backend `crates/backend/src/dto.rs`, surface web mobile `frontend/src/features/web/*`.
|
||||
- UX: ne pas exposer `invalid node id` brut; fallback sûr + message générique si feedback nécessaire (`Impossible d’ouvrir cette vue.` / `L’emplacement demandé n’est plus disponible. Réessayez depuis l’écran actuel.`).
|
||||
- Architect: cause probable validée. `WebAgentCell` mobile custom forge `nodeId: web-mobile-${agentId}` au lieu d’utiliser le vrai `nodeId` reçu ou rien. Backend à conserver strict (UUID valide uniquement). Fix propriétaire frontend.
|
||||
- Git: branche décidée `fix/225-web-mobile-invalid-node-id` basée sur `develop` @ `bd9f2cb`; commits de fix séparés du bookkeeping Idea; merge local après QA verte uniquement.
|
||||
- DevFrontend: fix livré. `WebAgentCell` passe désormais le vrai `nodeId` ou rien; `CustomAgentChatView` rend `nodeId` optionnel, n’envoie `nodeId` au launch que s’il existe, et masque l’erreur technique brute en mobile derrière un message générique. Tests ciblés `WebAgentCell.test.tsx` verts (11 tests), `npm run typecheck` vert.
|
||||
- QA: verdict VERT. Commandes validées sur `fix/225-web-mobile-invalid-node-id`: `npm test -- --run src/features/web/WebAgentCell.test.tsx` (11/11), `npm run typecheck`, `npm run build:web`. Aucun finding bloquant.
|
||||
- Prochaine étape: demander à Git de commit/merge local conformément à la stratégie décidée.
|
||||
17
.ideai/tickets/225/issue.md
Normal file
17
.ideai/tickets/225/issue.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
id: "469d94ea-55bd-457f-ab6d-7445446887fe"
|
||||
number: 225
|
||||
title: "Bug web mobile: invalid node id avec la custom CLI téléphone"
|
||||
status: "qa"
|
||||
priority: "high"
|
||||
sprint: null
|
||||
links: []
|
||||
agentRefs: []
|
||||
attachments: []
|
||||
createdBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
updatedBy: {"kind":"agent","agent_id":"a6c6ea12-bfc6-4bdc-8031-324102dfa34d"}
|
||||
createdAt: 1787224424729
|
||||
updatedAt: 1787224897257
|
||||
version: 6
|
||||
---
|
||||
Sur la version web mobile/téléphone, l'ouverture ou l'usage de la custom CLI remonte encore une erreur `invalid node id`. Le symptôme semble lié au mode custom CLI mobile (`frontend/src/features/web/WebAgentCell.tsx`) et/ou à la validation backend du `nodeId` lors de l'attache/lancement de session. Objectif: reproduire, identifier la cause, corriger, puis valider par tests réels frontend/backend selon le périmètre.
|
||||
@ -1,3 +1,3 @@
|
||||
{
|
||||
"nextNumber": 222
|
||||
"nextNumber": 226
|
||||
}
|
||||
@ -2968,7 +2968,7 @@
|
||||
"kind": "agent",
|
||||
"agent_id": "a6c6ea12-bfc6-4bdc-8031-324102dfa34d"
|
||||
},
|
||||
"updatedAt": 1786982821404
|
||||
"updatedAt": 1787224101407
|
||||
},
|
||||
{
|
||||
"issueRef": "#220",
|
||||
@ -3002,7 +3002,7 @@
|
||||
"issueRef": "#224",
|
||||
"path": "224",
|
||||
"title": "Version web téléphone: permettre le passage en custom CLI avec UI mobile adaptée",
|
||||
"status": "qa",
|
||||
"status": "closed",
|
||||
"priority": "high",
|
||||
"sprint": null,
|
||||
"assignedAgentIds": [
|
||||
@ -3013,7 +3013,21 @@
|
||||
"kind": "agent",
|
||||
"agent_id": "a6c6ea12-bfc6-4bdc-8031-324102dfa34d"
|
||||
},
|
||||
"updatedAt": 1787222847970
|
||||
"updatedAt": 1787223037400
|
||||
},
|
||||
{
|
||||
"issueRef": "#225",
|
||||
"path": "225",
|
||||
"title": "Bug web mobile: invalid node id avec la custom CLI téléphone",
|
||||
"status": "qa",
|
||||
"priority": "high",
|
||||
"sprint": null,
|
||||
"assignedAgentIds": [],
|
||||
"createdBy": {
|
||||
"kind": "agent",
|
||||
"agent_id": "a6c6ea12-bfc6-4bdc-8031-324102dfa34d"
|
||||
},
|
||||
"updatedAt": 1787224897257
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -44,7 +44,7 @@ export interface CustomAgentChatViewProps {
|
||||
profile: AgentProfile;
|
||||
cwd: string;
|
||||
layoutId?: string;
|
||||
nodeId: string;
|
||||
nodeId?: string;
|
||||
sessionId: string | null;
|
||||
conversationId: string | null;
|
||||
composerHeightPx?: number;
|
||||
@ -125,6 +125,11 @@ function describe(e: unknown): string {
|
||||
return String(e);
|
||||
}
|
||||
|
||||
function describeOpenFailure(e: unknown, mobile: boolean): string {
|
||||
if (!mobile) return describe(e);
|
||||
return "Le CLI custom n'a pas pu démarrer. Vérifiez la configuration du profil ou utilisez la TUI native.";
|
||||
}
|
||||
|
||||
function instrumentationError(e: unknown): Record<string, unknown> {
|
||||
if (e && typeof e === "object") {
|
||||
const err = e as GatewayError & { name?: string };
|
||||
@ -803,6 +808,7 @@ export function CustomAgentChatView({
|
||||
onSessionIdRef.current = onSessionId;
|
||||
const onConversationIdRef = useRef(onConversationId);
|
||||
onConversationIdRef.current = onConversationId;
|
||||
const domId = nodeId ?? `agent-${agentId}`;
|
||||
|
||||
const clampComposerHeight = useCallback(
|
||||
(heightPx: number): number => {
|
||||
@ -891,7 +897,7 @@ export function CustomAgentChatView({
|
||||
const slashPrefix = slashCommandPrefix(draft);
|
||||
const draftScope = useMemo<ChatDraftScope | null>(() => {
|
||||
if (explicitDraftScope) return explicitDraftScope;
|
||||
return layoutId ? { projectId, layoutId, nodeId } : null;
|
||||
return layoutId && nodeId ? { projectId, layoutId, nodeId } : null;
|
||||
}, [explicitDraftScope, layoutId, nodeId, projectId]);
|
||||
const currentConversationCacheKey = useMemo(
|
||||
() => conversationCacheKey(projectId, agentId, conversationId),
|
||||
@ -1173,7 +1179,7 @@ export function CustomAgentChatView({
|
||||
options.conversationId === undefined
|
||||
? conversationId ?? undefined
|
||||
: options.conversationId ?? undefined,
|
||||
nodeId,
|
||||
...(nodeId ? { nodeId } : {}),
|
||||
};
|
||||
console.debug("[ticket149] recoverStructuredSession:launchAgentChat:start", {
|
||||
timestamp: new Date().toISOString(),
|
||||
@ -1365,7 +1371,7 @@ export function CustomAgentChatView({
|
||||
sessionId: externalSessionId,
|
||||
error: instrumentationError(e),
|
||||
});
|
||||
if (!cancelled) setError(describe(e));
|
||||
if (!cancelled) setError(describeOpenFailure(e, mobile));
|
||||
} finally {
|
||||
if (!cancelled) setOpening(false);
|
||||
}
|
||||
@ -1384,6 +1390,7 @@ export function CustomAgentChatView({
|
||||
applyChatViewState,
|
||||
currentConversationCacheKey,
|
||||
conversationId,
|
||||
mobile,
|
||||
]);
|
||||
|
||||
const canSend = useMemo(
|
||||
@ -1822,7 +1829,7 @@ export function CustomAgentChatView({
|
||||
<div
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby={`profile-command-title-${nodeId}`}
|
||||
aria-labelledby={`profile-command-title-${domId}`}
|
||||
className={cn(
|
||||
"border border-border bg-surface p-3 shadow-lg",
|
||||
mobile
|
||||
@ -1833,7 +1840,7 @@ export function CustomAgentChatView({
|
||||
<div className="flex min-w-0 items-start justify-between gap-3">
|
||||
<div className="min-w-0">
|
||||
<h2
|
||||
id={`profile-command-title-${nodeId}`}
|
||||
id={`profile-command-title-${domId}`}
|
||||
className="text-sm font-semibold text-content"
|
||||
>
|
||||
Changer de profil
|
||||
@ -1979,7 +1986,7 @@ export function CustomAgentChatView({
|
||||
)}
|
||||
{slashMenuOpen && slashCommands.length > 0 && (
|
||||
<div
|
||||
id={`slash-command-menu-${nodeId}`}
|
||||
id={`slash-command-menu-${domId}`}
|
||||
role="listbox"
|
||||
aria-label="suggestions commandes slash"
|
||||
className="max-h-48 overflow-y-auto rounded-md border border-border bg-surface py-1 shadow-lg"
|
||||
@ -1991,7 +1998,7 @@ export function CustomAgentChatView({
|
||||
<button
|
||||
key={command.name}
|
||||
type="button"
|
||||
id={`slash-command-${nodeId}-${index}`}
|
||||
id={`slash-command-${domId}-${index}`}
|
||||
role="option"
|
||||
aria-selected={selected}
|
||||
aria-disabled={!available}
|
||||
@ -2019,10 +2026,10 @@ export function CustomAgentChatView({
|
||||
<div className="relative flex min-w-0 flex-1">
|
||||
<textarea
|
||||
ref={composerRef}
|
||||
aria-label={`message CLI custom ${nodeId}`}
|
||||
aria-controls={slashMenuOpen ? `slash-command-menu-${nodeId}` : undefined}
|
||||
aria-label={`message CLI custom ${domId}`}
|
||||
aria-controls={slashMenuOpen ? `slash-command-menu-${domId}` : undefined}
|
||||
aria-activedescendant={
|
||||
slashMenuOpen ? `slash-command-${nodeId}-${slashActiveIndex}` : undefined
|
||||
slashMenuOpen ? `slash-command-${domId}-${slashActiveIndex}` : undefined
|
||||
}
|
||||
className={cn(
|
||||
"min-h-10 flex-1 resize-none rounded-md border border-border bg-surface p-2 pr-7 text-sm text-content outline-none",
|
||||
@ -2069,7 +2076,7 @@ export function CustomAgentChatView({
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
aria-label={`redimensionner le composer ${nodeId}`}
|
||||
aria-label={`redimensionner le composer ${domId}`}
|
||||
title="Redimensionner le composer"
|
||||
className="absolute right-1.5 top-1.5 h-4 w-4 rounded-sm border border-border bg-raised text-[9px] leading-3 text-muted hover:text-content focus:border-primary focus:outline-none"
|
||||
style={{ cursor: "ns-resize" }}
|
||||
|
||||
@ -113,10 +113,26 @@ describe("WebAgentCell", () => {
|
||||
|
||||
expect(await screen.findByTestId("custom-agent-chat-view")).toBeTruthy();
|
||||
expect(screen.queryByTestId("terminal-key-bar")).toBeNull();
|
||||
await waitFor(() => expect(launchChatSpy).toHaveBeenCalledTimes(1));
|
||||
expect(launchChatSpy.mock.calls[0][2]).toMatchObject({ cwd: "/srv/demo" });
|
||||
expect(launchChatSpy.mock.calls[0][2]).not.toHaveProperty("nodeId");
|
||||
});
|
||||
|
||||
it("propagates the real leaf node id to the mobile custom CLI when provided", async () => {
|
||||
const { agent, profile, agentId } = await seededAgentGateway(structuredProfile);
|
||||
const launchChatSpy = vi.spyOn(agent, "launchAgentChat");
|
||||
const leafNodeId = "1efdd2dd-981d-431b-915c-1dd5e976fdd5";
|
||||
|
||||
renderCell(agent, profile, agentId, {
|
||||
fullHeight: true,
|
||||
nodeId: leafNodeId,
|
||||
});
|
||||
fireEvent.click(await screen.findByRole("button", { name: "CLI custom" }));
|
||||
|
||||
await waitFor(() => expect(launchChatSpy).toHaveBeenCalledTimes(1));
|
||||
expect(launchChatSpy.mock.calls[0][2]).toMatchObject({
|
||||
cwd: "/srv/demo",
|
||||
nodeId: `web-mobile-${agentId}`,
|
||||
nodeId: leafNodeId,
|
||||
});
|
||||
});
|
||||
|
||||
@ -149,10 +165,8 @@ describe("WebAgentCell", () => {
|
||||
|
||||
await waitFor(() => expect(launchChatSpy).toHaveBeenCalledTimes(1));
|
||||
await waitFor(() => expect(reattachChatSpy).toHaveBeenCalledTimes(1));
|
||||
expect(launchChatSpy.mock.calls[0][2]).toMatchObject({
|
||||
cwd: "/srv/demo",
|
||||
nodeId: `web-mobile-${agentId}`,
|
||||
});
|
||||
expect(launchChatSpy.mock.calls[0][2]).toMatchObject({ cwd: "/srv/demo" });
|
||||
expect(launchChatSpy.mock.calls[0][2]).not.toHaveProperty("nodeId");
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "TUI native" }));
|
||||
await waitFor(() => expect(screen.queryByTestId("custom-agent-chat-view")).toBeNull());
|
||||
@ -183,11 +197,11 @@ describe("WebAgentCell", () => {
|
||||
expect(launchChatSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("surfaces a mobile custom CLI launch failure when the runtime cannot find node", async () => {
|
||||
it("surfaces a generic mobile custom CLI launch failure", async () => {
|
||||
const { agent, profile, agentId } = await seededAgentGateway(structuredProfile);
|
||||
const launchChatSpy = vi.spyOn(agent, "launchAgentChat").mockRejectedValueOnce({
|
||||
code: "PROCESS",
|
||||
message: "spawn node ENOENT: node is not installed on this runtime",
|
||||
message: "invalid node id: web-mobile-agent-1",
|
||||
});
|
||||
const reattachChatSpy = vi.spyOn(agent, "reattachAgentChat");
|
||||
|
||||
@ -195,12 +209,12 @@ describe("WebAgentCell", () => {
|
||||
fireEvent.click(await screen.findByRole("button", { name: "CLI custom" }));
|
||||
|
||||
await waitFor(() => expect(launchChatSpy).toHaveBeenCalledTimes(1));
|
||||
expect(launchChatSpy.mock.calls[0][2]).toMatchObject({
|
||||
cwd: "/srv/demo",
|
||||
nodeId: `web-mobile-${agentId}`,
|
||||
});
|
||||
expect(launchChatSpy.mock.calls[0][2]).toMatchObject({ cwd: "/srv/demo" });
|
||||
expect(launchChatSpy.mock.calls[0][2]).not.toHaveProperty("nodeId");
|
||||
expect(reattachChatSpy).not.toHaveBeenCalled();
|
||||
expect((await screen.findByRole("alert")).textContent).toContain("spawn node ENOENT");
|
||||
const alertText = (await screen.findByRole("alert")).textContent ?? "";
|
||||
expect(alertText).toContain("Le CLI custom n'a pas pu démarrer");
|
||||
expect(alertText).not.toContain("invalid node id");
|
||||
});
|
||||
|
||||
it("falls back to native TUI when the mobile agent loses custom CLI support", async () => {
|
||||
|
||||
@ -203,7 +203,7 @@ export function WebAgentCell({
|
||||
agentName={resolvedAgent.name}
|
||||
profile={resolvedProfile}
|
||||
cwd={cwd}
|
||||
nodeId={`web-mobile-${agentId}`}
|
||||
nodeId={nodeId}
|
||||
sessionId={customSessionId}
|
||||
conversationId={customConversationId}
|
||||
draftScope={draftScope}
|
||||
|
||||
Reference in New Issue
Block a user