Watch
0
0
Fork
You've already forked hyperhive
0

review classifier: every ACP run gets one shared, empty cwd

opencode writes the session's cwd into the system message's environment
block ("Working directory: …", "Workspace root folder: …"), ahead of the
PR's user message. Each ACP classification ran with its per-call scratch
directory, /tmp/review-classifier-<pid>-<counter>, as cwd, so every call
sent a different system message and the provider's prompt cache could not
match past it.

The session's cwd is now one fixed directory, <tmp>/review-classifier-acp-cwd,
shared by every run. HOME (the config, system.md and opencode's own state)
stays a directory per run, removed after it, as before. With no tool and
no project config nothing writes into the cwd: a live opencode 1.15.10 run
through initialize, session/new and a prompt left it empty, with its state
all under HOME. So concurrent runs can share it, and no state carries from
one run to the next.

Refs #5245
This commit is contained in:
atlas 2026-10-14 14:06:55 +02:00 • committed by mara
commit 2fb6b39f9f
4 changed files with 70 additions and 11 deletions

View file

@ -3,11 +3,11 @@
//!
//! On the API key runtime each classification is one `claude --print` with
//! no session, no tools and no MCP server; on the ACP runtime it is one
//! prompt on a new ACP session ([`crate::acp`]). Either way it runs in a
//! directory made for it and removed after it, so nothing carries from one
//! run to the next. The key is read from the store for every run and reaches
//! only the child's environment, which keeps nothing of the daemon's beyond
//! [`crate::child_env`]'s allowlist.
//! prompt on a new ACP session ([`crate::acp`]). Either way its files live
//! in a directory made for it and removed after it, so nothing carries from
//! one run to the next. The key is read from the store for every run and
//! reaches only the child's environment, which keeps nothing of the daemon's
//! beyond [`crate::child_env`]'s allowlist.
use std::future::Future;
use std::path::{Path, PathBuf};