From 67b45858e6ef28f75dd83a941ed8033ecfc592c6 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Wed, 7 Oct 2026 16:27:50 -0700 Subject: [PATCH] Aesel rock names the engine that answers it provider_agent_type was hardcoded to codex. connected() now stamps the backend id, including after a /backend swap. Co-Authored-By: Claude Opus 5.5 --- aesel/src/slab-session.mjs | 8 +++++--- aesel/src/tui.mjs | 6 +++--- aesel/test/slab-session.test.mjs | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/aesel/src/slab-session.mjs b/aesel/src/slab-session.mjs index d3210a5ab4..d20f55d712 100644 --- a/aesel/src/slab-session.mjs +++ b/aesel/src/slab-session.mjs @@ -115,7 +115,9 @@ export class SlabSession { // what it is showing is the current save, a save still on its way, or a // push in flight. Without them a frozen frame and a live one look alike. flow: "live", - provider_agent_type: "codex", + // Which engine answers this rock: claude, codex, ac or open. Set on + // connect, because /backend can swap it mid-session. + provider_agent_type: "", provider_session_id: "", updated: now(), started_at: now(), @@ -140,8 +142,8 @@ export class SlabSession { return this.sessionId; } - connected(providerSessionId) { - this.#update({ provider_session_id: providerSessionId || "" }); + connected(providerSessionId, providerAgentType = "") { + this.#update({ provider_session_id: providerSessionId || "", provider_agent_type: providerAgentType }); } snapshot() { diff --git a/aesel/src/tui.mjs b/aesel/src/tui.mjs index d5ba91bffe..075a3bfa30 100755 --- a/aesel/src/tui.mjs +++ b/aesel/src/tui.mjs @@ -2222,7 +2222,7 @@ async function restartEngine(note, nextBackend = backend, nextModel = model, nex if(nextBackend.id === "ac" && previousBackend.id === "ac") { engine.messages = structuredClone(previous.messages); engine.turns = previous.turns; } const connection = await engine.connect(); previous.close(); - slabSession.connected(engine.threadId); + slabSession.connected(engine.threadId, backend.id); state.model = connection?.model || model; await rememberProvider(); saveDesktopIdle(); @@ -2374,7 +2374,7 @@ async function commandNew(rest) { }); state.entries=[]; state.input='';state.cursor=0;state.queued=[];state.scrollOffset=0; - slabSession.connected(engine.threadId); + slabSession.connected(engine.threadId, backend.id); if(state.medium==='piece') { live.watch(liveError);refreshQr();live.push().catch(liveError); if(rest!=='thread') { blankPublished=false;autopublish.published=null;publishBlankOnce(); } @@ -3478,7 +3478,7 @@ try { await inboxReady; markStartup('engine-connected');flushStartupTrace(); bootDone(); - slabSession.connected(connection?.thread?.id || engine.threadId); + slabSession.connected(connection?.thread?.id || engine.threadId, backend.id); state.status = "ready"; state.model = connection?.model || model; // The bottom line names the model properly once the provider's list is diff --git a/aesel/test/slab-session.test.mjs b/aesel/test/slab-session.test.mjs index ff2a810067..bd028575c4 100644 --- a/aesel/test/slab-session.test.mjs +++ b/aesel/test/slab-session.test.mjs @@ -48,10 +48,11 @@ test("publishes the full Slab prompt lifecycle", async (context) => { assert.equal(marker.agent_type, "aesel"); assert.equal(marker.state, "blank"); - session.connected("00000000-0000-0000-0000-000000000001"); + session.connected("00000000-0000-0000-0000-000000000001", "claude"); session.working("make this window visible to prox"); marker = await readJson(active); assert.equal(marker.provider_session_id, "00000000-0000-0000-0000-000000000001"); + assert.equal(marker.provider_agent_type, "claude"); assert.equal(marker.subject, "make this window visible to prox"); assert.equal(marker.state, "working"); assert.equal(await exists(running), true); -- 2.51.2