GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(temper): inject OPENCODE_SESSION_ID into bash environment by cbarber · Pull Request #92 · cbarber/llm-tools

Conversation

@cbarber

@cbarber cbarber commented Feb 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

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)

Stack:

  • feat(pr-notify): extract session ID from PR description #110
  • feat(pr-poll): discover PRs from repository state #109
  • feat(pr-poll): move state files to ~/.local/share/nixsmith #106
  • feat(git): inject session ID into commit messages #105
  • feat(opencode): disable global daemon startup by default #97
  • feat(forge): auto-start session-scoped daemon on pr create #96
  • feat(spr): auto-start session-scoped daemon on spr update #95
  • feat(pr-notify): accept explicit session ID parameter #94
  • feat(temper): inject OPENCODE_SESSION_ID into bash environment #92 ⬅
  • chore(opencode): update to version 1.2.4 #111

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Feb 1, 2026
feat(pr-poll): add session-scoped daemon and atomic state writes #93
Closed
feat(pr-notify): accept explicit session ID parameter #94
Merged
feat(spr): auto-start session-scoped daemon on spr update #95
Open
feat(forge): auto-start session-scoped daemon on pr create #96
Open
feat(opencode): disable global daemon startup by default #97
Closed
cbarber
cbarber commented Feb 2, 2026
View reviewed changes
Comment thread .opencode/plugin/temper/index.ts Outdated

if (tool === "bash" && input.args?.command) {
const originalCommand = input.args.command;
input.args.command = `export OPENCODE_SESSION_ID="${sessionID}"; ${originalCommand}`;

@cbarber cbarber Feb 2, 2026

Copy link
Copy Markdown
Owner Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sufficient?
anomalyco/opencode#11065
anomalyco/opencode#11068

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cbarber cbarber Feb 2, 2026

Copy link
Copy Markdown
Owner Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will check the linked OpenCode issue/PR to see if there's a better mechanism for environment injection. The current approach modifies input.args.command but may execute too late in the pipeline.


🤖 Posted by agent

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cbarber cbarber Feb 2, 2026

Copy link
Copy Markdown
Owner Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed to use output.args.env instead of modifying command. This uses OpenCode PR #11068 approach which is the proper way to inject environment variables.


🤖 Posted by agent

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cbarber cbarber Feb 2, 2026

Copy link
Copy Markdown
Owner Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted to prepending export to command - the output.args.env approach requires OpenCode PR #11068 which isn't merged yet. Will switch to env parameter once that PR lands. Current approach works but has permission limitations as you noted.


🤖 Posted by agent

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cbarber
cbarber force-pushed the spr/main/295171f4 branch 3 times, most recently from b0f7808 to 063adbc Compare February 2, 2026 13:16
@cbarber cbarber mentioned this pull request Feb 2, 2026
test: verify session ID injection works #102
Open
@cbarber

cbarber commented Feb 6, 2026

Copy link
Copy Markdown
Owner Author

🚀

github-actions[bot] reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

github-actions[bot]
github-actions Bot approved these changes Feb 6, 2026
View reviewed changes

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via 🚀 comment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cbarber cbarber mentioned this pull request Feb 14, 2026
feat(git): inject session ID into commit messages #105
Open
@cbarber
cbarber force-pushed the spr/main/295171f4 branch from 063adbc to cab95a6 Compare February 14, 2026 04:13
This was referenced Feb 14, 2026
feat(pr-poll): move state files to ~/.local/share/nixsmith #106
Open
feat(spr,forge): use new state directory for daemon files #107
Open
feat(pr-notify): extract session ID from PR description #108
Open
feat(pr-poll): discover PRs from repository state #109
Open
feat(pr-notify): extract session ID from PR description #110
Open
@cbarber
cbarber force-pushed the spr/main/295171f4 branch from cab95a6 to 86f8e5a Compare February 15, 2026 02:02
@cbarber

cbarber commented Feb 15, 2026

Copy link
Copy Markdown
Owner Author

Updated to use the shell.env plugin hook from OpenCode PR #12012 (merged Feb 3). This properly injects OPENCODE_SESSION_ID into all bash commands, shell mode, and PTY terminals without modifying the command string.

The previous output.args.command approach caused exponential growth of export statements. The shell.env hook is the correct mechanism for environment variable injection.


🤖 Posted by agent

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cbarber
cbarber force-pushed the spr/main/295171f4 branch from 86f8e5a to 816e276 Compare February 15, 2026 02:10
@cbarber cbarber mentioned this pull request Feb 15, 2026
chore(opencode): update to version 1.2.4 #111
Closed
@cbarber
cbarber changed the base branch from main to spr/main/83576793 February 15, 2026 02:10
@cbarber
cbarber force-pushed the spr/main/295171f4 branch from 816e276 to ff1c6ae Compare February 15, 2026 02:45
@cbarber
cbarber force-pushed the spr/main/83576793 branch from 9e35d8e to e92ce10 Compare February 15, 2026 02:45
@cbarber
feat(temper): inject OPENCODE_SESSION_ID into bash environment
7afd532
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
@cbarber
cbarber force-pushed the spr/main/295171f4 branch from ff1c6ae to 7afd532 Compare February 15, 2026 03:46
@cbarber
cbarber force-pushed the spr/main/83576793 branch from e92ce10 to 6b2834f Compare February 15, 2026 03:46
@cbarber

cbarber commented Feb 15, 2026

Copy link
Copy Markdown
Owner Author

Testing notification system - shell.env hook is now working! ✅


🤖 Posted by agent

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cbarber

cbarber commented Feb 15, 2026

Copy link
Copy Markdown
Owner Author

✓ Commit merged in pull request #94

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cbarber cbarber closed this Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@github-actions github-actions[bot] github-actions[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@cbarber
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.