Install OpenCode hooks in the terminal's config directory (#25296)

* test: reproduce OpenCode plugin installation in the wrong config root

* fix: install OpenCode hooks in the execution config directory

* test: isolate config installation from CLI version probing

* style: format consumer config installation controls

* fix: use checked startup environment and supported relay shell context

* fix: install OpenCode hooks using the selected execution shell

* test(opencode): assert consumer config root in PTY fixtures

---------

Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Orca <orca@stably.ai>
This commit is contained in:
Neil
2026-10-04 15:20:07 -07:00
committed by GitHub
co-authored by Codex Orca
parent f371532707
commit 8ff6ec9fb1
13 changed files with 232 additions and 23 deletions
+6 -2
View File
@@ -121,7 +121,11 @@ export class OpenCodeHookService {
}
}
buildPtyEnv(ptyId: string, existingConfigDir?: string | undefined): Record<string, string> {
buildPtyEnv(
ptyId: string,
existingConfigDir?: string | undefined,
defaultConfigDir?: string
): Record<string, string> {
if (!isUsableId(ptyId)) {
// Why: on a bad id, still preserve a user-set OPENCODE_CONFIG_DIR; only the Orca status plugin is forfeited.
return existingConfigDir ? { OPENCODE_CONFIG_DIR: existingConfigDir } : {}
@@ -131,7 +135,7 @@ export class OpenCodeHookService {
const managedConfigDir = this.getSharedConfigDir()
if (!existingConfigDir || existingConfigDir === managedConfigDir) {
try {
this.writePluginToConfigDir(resolveOpenCodeConfigDirectory())
this.writePluginToConfigDir(defaultConfigDir ?? resolveOpenCodeConfigDirectory())
return {}
} catch {
return {}