mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 00:02:38 +00:00
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:
@@ -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 {}
|
||||
|
||||
Reference in New Issue
Block a user