From 13eb34133d8fe64f9c73f8d394e0af790b54c6e5 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Wed, 24 Jun 2026 04:02:48 +0900 Subject: docs: task 2 (system-prompt cwd reconstruction) done --- notes/pending-issues.md | 2 +- tasks.md | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/notes/pending-issues.md b/notes/pending-issues.md index 7dc1022..7e12332 100644 --- a/notes/pending-issues.md +++ b/notes/pending-issues.md @@ -16,7 +16,7 @@ ## 2. System context builder — referenced files not loaded -**Status:** PENDING. +**Status:** DONE (commit `b180cc1`). **Symptom:** The system context builder does not load referenced files that live in the conversation's working directory. Concrete reproduction: the orchestrator diff --git a/tasks.md b/tasks.md index 1edba70..2a34c18 100644 --- a/tasks.md +++ b/tasks.md @@ -5,7 +5,24 @@ > Keep this lean and current; do not let it re-accrete a step-by-step changelog. ## Status (current) -`tsc -b` EXIT 0 · biome clean · **1405 vitest** green. +`tsc -b` EXIT 0 · biome clean · **1411 vitest** green. + +## System-prompt stale on cwd change (DONE) +Bug: the system-prompt service constructed the resolved prompt once on the first +turn and reused it via `get()` on subsequent turns (cache-safe design). But the +prompt is cwd-sensitive (`[file:AGENTS.md]`, `[prompt:cwd]` variables). When a +conversation's cwd changed after the first turn, the cached prompt was stale — +referenced files from the new cwd were not loaded. +- **Wave 1 — `system-prompt`:** added `getWithMeta(conversationId)` returning + `{ prompt, cwd }` — reads both `resolved:` and a new `resolved-cwd:` + sibling key. `construct()` now also stores the cwd. All additive, no existing + method signature/behavior changed. +5 tests. +- **Wave 2 — `session-orchestrator`:** subsequent turns call `getWithMeta`, + compare stored cwd vs `effectiveCwd ?? process.cwd()`, and `construct` if they + differ (or if no stored prompt exists). Compaction path (always constructs) + and warm path (no system prompt) unaffected. +1 test. +- [x] Verified: `tsc -b` EXIT 0, biome clean, **1411 vitest** pass; both in-lane. +- No FE handoff needed (backend-only fix; no contract version bump). ## Workspace tab issue — conversation.open drops workspaceId (DONE) Cross-repo additive fix: `conversation.open` / `conversation.statusChanged` WS -- cgit v1.2.3