can1357/oh-my-pi · error · Error
Could not install omp configuration: ${writeConfig.stderr.tr
Error message
Could not install omp configuration: ${writeConfig.stderr.trim()} What it means
installAgent writes models.yml and config.yml into the guest's ~/.omp/agent via a heredoc shell script. If the composite command exits non-zero, this error is thrown with the shell's stderr.
Source
Thrown at packages/metaharness/src/tb/agent.ts:124
modelLines.push(` baseUrl: ${gateway.url}`);
modelLines.push(" auth: oauth");
modelLines.push(" transport: pi-native");
modelLines.push(` apiKey: ${gateway.token}`);
}
const modelsYaml = `${modelLines.join("\n")}\n`;
const configYaml = `providers:
openrouterVariant: ${gateway.openrouterVariant}
modelRoles:
vision: openrouter/qwen/qwen3.7-flash
edit:
mode: replace
web_search:
enabled: false
`;
const writeConfig = await vm.exec(
`mkdir -p "$HOME/.omp/agent"\ncat > "$HOME/.omp/agent/models.yml" <<'OMP_MODELS_EOF'\n${modelsYaml}OMP_MODELS_EOF\ncat > "$HOME/.omp/agent/config.yml" <<'OMP_CONFIG_EOF'\n${configYaml}OMP_CONFIG_EOF`,
);
if (writeConfig.exitCode !== 0) throw new Error(`Could not install omp configuration: ${writeConfig.stderr.trim()}`);
return entrypoint;
}
View on GitHub (pinned to 9690622007)
Solutions
- Read stderr for the failing sub-command (mkdir vs cat)
- Verify $HOME is set for the guest exec user (`vm.exec('echo $HOME')`)
- Check guest disk space and that ~/.omp/agent's parent is writable
- Ensure the exec transport preserves newlines verbatim in the command string
- Write configs via vm.copyTo of temp files instead of heredocs if transport mangles them
Example fix
// before: heredoc through exec transport
const writeConfig = await vm.exec(`cat > "$HOME/.omp/agent/models.yml" <<'OMP_MODELS_EOF'\n${modelsYaml}OMP_MODELS_EOF`);
// after: stage locally and copy
class Tmp { }
await vm.copyTo(modelsYamlPath, "/tmp/models.yml");
await vm.exec("mkdir -p $HOME/.omp/agent && mv /tmp/models.yml $HOME/.omp/agent/models.yml"); Defensive patterns
Strategy: fallback
Validate before calling
const home = (await vm.exec('echo -n "$HOME"')).stdout.trim();
if (!home) throw new Error("guest exec user has no $HOME"); Try / catch
try {
await installAgent(vm, binaries, gateway);
} catch (err) {
if (String(err.message).includes("Could not install omp configuration")) {
// fall back to vm.copyTo of staged config files
}
throw err;
} Prevention
- Prefer vm.copyTo over heredocs for multi-line config
- Ensure the exec user's $HOME exists and is writable
- Keep heredoc delimiters unique and newline-safe
When it happens
Trigger: The multi-line `mkdir -p ... cat > ... <<'EOF'` script fails — HOME unset or unwritable in the guest shell, disk full, heredoc mangled by the exec transport (quoting/newline handling), or `$HOME` expansion breaking under a non-login shell.
Common situations: Guest runs commands via sh -c where $HOME is not set (e.g. non-root exec user); YAML content contains a line matching the OMP_EOF delimiters (unlikely with unique delimiters); exec transport strips trailing newlines so the heredoc terminator is never seen and cat hangs or fails.
Related errors
- Custom shell path not found: ${customShellPath} Please updat
- unknown function: {0}
- unknown key binding function: {0}
- unimplemented: {0}
- I/O error occurred
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/0c61fab6775f99e2.
Report an issue: GitHub.