Skip to content

Commit cab95a6

Browse files
committed
feat(temper): inject OPENCODE_SESSION_ID into bash environment
Session-scoped pr-poll daemon needs to know which session triggered it. Prepending export to bash commands makes session ID available to shell scripts. Authored By: opencode (claude-sonnet-4-5) commit-id:295171f4
1 parent 05cb78f commit cab95a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.opencode/plugin/temper/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ export const TemperPlugin: Plugin = async ({ client, $, directory }) => {
191191

192192
await logEvent("workflow-event", { event: eventString });
193193

194+
if (tool === "bash" && output.args?.command) {
195+
const originalCommand = output.args.command;
196+
output.args.command = `export OPENCODE_SESSION_ID="${sessionID}"; ${originalCommand}`;
197+
}
198+
194199
try {
195200
const guidance = await $`bash tools/temper --event ${eventString}`.text();
196201
if (guidance && guidance.trim().length > 0) {

0 commit comments

Comments
 (0)