chat: OpenCode /chat cwd = general_chat_sessions (match Claude), drop home special-case

Both harnesses now use the resolved chat cwd as their working directory: Claude runs
in it natively, and OpenCode is told the same via its system prompt. Removes the
earlier special-case that pointed OpenCode at the user's home for /chat, so `workingDir`
collapses into `cwd` — which now both tags the session (metadata.officer.cwd) and drives
the Officer system prompt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 12:00:34 +00:00
co-authored by Claude Opus 4.8
parent 0c3f270419
commit 88b74b2888
2 changed files with 3 additions and 9 deletions
+2 -3
View File
@@ -14,8 +14,7 @@ type OpenCodeStreamingParams = {
username: string;
prompt: string;
sessionKey: string;
cwd?: string; // logical cwd for session tagging/listing (metadata.officer.cwd)
workingDir?: string; // the dir the model should treat as its cwd (Officer system prompt)
cwd?: string; // the session's working dir: tags it (metadata.officer.cwd) + told to the model (system prompt)
model?: string;
role?: string;
resumeSessionId?: string;
@@ -73,7 +72,7 @@ export async function sendOpenCodeStreaming(params: OpenCodeStreamingParams): Pr
unsub = conn.subscribe(sessionId, mapper);
const { providerID, modelID } = splitModel(params.model ?? '');
const system = params.workingDir ? officerSystemPrompt(params.workingDir) : undefined;
const system = params.cwd ? officerSystemPrompt(params.cwd) : undefined;
// Fire the turn; assistant tokens + tool calls stream back over the SSE subscription above.
conn.postMessage(sessionId, providerID, modelID, params.prompt, system).catch((err) => {