Bug Description
oc-codex-multi-auth appears to install a SIGINT handler that calls process.exit(0) after plugin cleanup. This can preempt opencode's own Ctrl+C/shutdown cleanup path. In my case, after pressing Ctrl+C to exit opencode, opencode no longer echoes/prints the session id as it did before.
The behavior points to the plugin taking ownership of process termination on Ctrl+C instead of letting the host opencode process finish its own shutdown handling.
Steps to Reproduce
- Install/use opencode with
oc-codex-multi-auth enabled in the opencode config.
- Start an interactive opencode session.
- Let opencode complete a task.
- Press Ctrl+C to exit.
- Observe whether opencode prints/echoes the session id during shutdown.
Expected Behavior
The plugin should run any needed cleanup, but opencode should still be able to complete its normal Ctrl+C/shutdown behavior, including printing/echoing the session id.
Actual Behavior
With oc-codex-multi-auth enabled, pressing Ctrl+C exits without opencode printing/echoing the session id.
Environment
- opencode version:
1.17.13 installed via Homebrew
- Plugin version:
6.5.0
- Operating System: macOS darwin arm64
- Node.js version:
v26.0.0
Logs
No request logs attached. This appears to be local signal/shutdown behavior rather than a backend request issue.
Compliance Checklist
Please confirm:
Additional Context
The likely cause is in dist/lib/shutdown.js:
const handleSignal = () => {
void runCleanup().finally(() => {
process.exit(0);
});
};
process.once("SIGINT", handleSignal);
process.once("SIGTERM", handleSignal);
Because the plugin calls process.exit(0) from its SIGINT handler, the host opencode process may not get a chance to finish its own shutdown/exit handling.
I tested a local patch that keeps plugin cleanup on SIGINT but does not call process.exit() for SIGINT. In a small simulation, cleanup still ran and SIGINT no longer forced process exit:
const handleSignal = (signal) => {
void runCleanup().finally(() => {
if (signal === "SIGTERM") {
process.exit(0);
}
});
};
process.once("SIGINT", () => handleSignal("SIGINT"));
process.once("SIGTERM", () => handleSignal("SIGTERM"));
Suggested fix: avoid calling process.exit() from the plugin's SIGINT handler. Let opencode remain responsible for process termination on Ctrl+C, while the plugin still performs cleanup.
Related but not a duplicate: #176 discusses abort behavior around client teardown, but this report is specifically about the plugin's SIGINT handler swallowing opencode's exit/session-id behavior.
Bug Description
oc-codex-multi-authappears to install aSIGINThandler that callsprocess.exit(0)after plugin cleanup. This can preempt opencode's own Ctrl+C/shutdown cleanup path. In my case, after pressing Ctrl+C to exit opencode, opencode no longer echoes/prints the session id as it did before.The behavior points to the plugin taking ownership of process termination on Ctrl+C instead of letting the host opencode process finish its own shutdown handling.
Steps to Reproduce
oc-codex-multi-authenabled in the opencode config.Expected Behavior
The plugin should run any needed cleanup, but opencode should still be able to complete its normal Ctrl+C/shutdown behavior, including printing/echoing the session id.
Actual Behavior
With
oc-codex-multi-authenabled, pressing Ctrl+C exits without opencode printing/echoing the session id.Environment
1.17.13installed via Homebrew6.5.0v26.0.0Logs
No request logs attached. This appears to be local signal/shutdown behavior rather than a backend request issue.
Compliance Checklist
Please confirm:
Additional Context
The likely cause is in
dist/lib/shutdown.js:Because the plugin calls
process.exit(0)from itsSIGINThandler, the host opencode process may not get a chance to finish its own shutdown/exit handling.I tested a local patch that keeps plugin cleanup on
SIGINTbut does not callprocess.exit()forSIGINT. In a small simulation, cleanup still ran andSIGINTno longer forced process exit:Suggested fix: avoid calling
process.exit()from the plugin'sSIGINThandler. Let opencode remain responsible for process termination on Ctrl+C, while the plugin still performs cleanup.Related but not a duplicate: #176 discusses abort behavior around client teardown, but this report is specifically about the plugin's
SIGINThandler swallowing opencode's exit/session-id behavior.