diff options
| author | Adam Malczewski <[email protected]> | 2026-06-29 00:21:37 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-29 00:21:37 +0900 |
| commit | a2e3bad36fd236835423e3e9124b8496b6d9c795 (patch) | |
| tree | caf612de054293fdc905fb940a25100f712a944c /docker | |
| parent | 8175a3df065155c5a164e29bd1c47aad392ae555 (diff) | |
| download | dispatch-a2e3bad36fd236835423e3e9124b8496b6d9c795.tar.gz dispatch-a2e3bad36fd236835423e3e9124b8496b6d9c795.zip | |
fix(summon-title): defer title set until after workspace initialization
Setting the title in the HTTP /chat route BEFORE the turn started pre-created
the conversation meta, which made the orchestrator's getConversationMeta ===
null newness check falsely report an EXISTING conversation. As a result
ensureWorkspace / setWorkspaceId / the first-turn systemPromptService.construct
were ALL skipped for summoned conversations with a title — leaving them with no
assigned workspace and breaking downstream cwd resolution + system-prompt init.
Fix: the title is no longer set in the route. It is threaded through
StartTurnInput -> handleMessage -> startTurn -> runTurnDetached and persisted
via setConversationTitle INSIDE workspaceSetupPromise, AFTER the newness check
+ workspace assignment (so init still fires for new conversations) and BEFORE
the first message append (so the append's auto-derived title does not overwrite
it). The title set is best-effort: a failure is logged but does not break the
turn (the workspace setup already succeeded).
The /chat route now forwards title into the orchestrator input instead of
calling setConversationTitle itself.
Tests:
- app.test.ts: route tests rewritten to assert the route forwards title to the
orchestrator and does NOT call setConversationTitle itself.
- orchestrator.test.ts: 5 new regression tests, including the critical 'titled
new conversation still gets workspace assigned + system-prompt constructed +
title set', an ordering test (title set after getMeta/ensureWorkspace/
setWorkspaceId), and a resilience test (turn completes if setConversationTitle
throws).
Verification: typecheck EXIT 0; test 2026 passed | 6 skipped | 0 failed;
check EXIT 0 (12 pre-existing warnings in untouched files).
Diffstat (limited to 'docker')
0 files changed, 0 insertions, 0 deletions
