Set default working directory for OpenCode to ~/Workspace

This commit is contained in:
Adolfo Reyna
2026-08-07 19:13:34 -04:00
parent 40a4107bc9
commit b510cedbf8
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -508,6 +508,7 @@ def build_llm(args: argparse.Namespace, vocabulary=None, brain=None, observer=No
system_prompt += "\n\n" + memory
return OpenCodeLLM(
model=args.opencode_model,
cwd=args.cwd,
system_prompt=system_prompt,
observer=observer,
)
+4
View File
@@ -79,12 +79,14 @@ class OpenCodeLLM(FrameProcessor):
self,
*,
model: str = "ollama-cloud/gemma4:31b",
cwd: str | Path | None = None,
system_prompt: str | None = None,
observer=None,
**kwargs,
):
super().__init__(**kwargs)
self._model = model
self._cwd = Path(cwd or Path.home() / "Workspace").expanduser().resolve()
self._system_prompt = system_prompt or "You are a helpful spoken voice assistant. Keep answers brief and conversational."
self._on_reply = observer
self._turn_task: asyncio.Task | None = None
@@ -157,11 +159,13 @@ class OpenCodeLLM(FrameProcessor):
self._cli_path,
"run",
"-m", self._model,
"--dir", str(self._cwd),
"--pure",
prompt_str,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
stdin=asyncio.subprocess.DEVNULL,
cwd=str(self._cwd),
)
while True: