Skip to content

ENH: opt-in GH_TOKEN_* passthrough for bwopencode#14

Merged
Thomas A Caswell (tacaswell) merged 2 commits into
NSLS2:mainfrom
stuwilkins:add_gh_token_passthrough
Jul 22, 2026
Merged

ENH: opt-in GH_TOKEN_* passthrough for bwopencode#14
Thomas A Caswell (tacaswell) merged 2 commits into
NSLS2:mainfrom
stuwilkins:add_gh_token_passthrough

Conversation

@stuwilkins

Copy link
Copy Markdown
Contributor

Add --github-tokens to forward GH_TOKEN_* env vars into the sandbox so the agent can authenticate gh(1) via per-command token selection. Off by default; values are printed as REDACTED under --dry-run so tokens never reach the terminal.

Assisted-by: opencode:claude-opus-4-8
Assisted-by: opencode:claude-sonnet-4-6

Add --github-tokens to forward GH_TOKEN_* env vars into the sandbox
so the agent can authenticate gh(1) via per-command token selection.
Off by default; values are printed as REDACTED under --dry-run so tokens
never reach the terminal.

Assisted-by: opencode:claude-opus-4-8
Assisted-by: opencode:claude-sonnet-4-6

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in --github-tokens flag to bwopencode to forward GH_TOKEN_* environment variables into the bubblewrap sandbox, enabling per-command GitHub CLI (gh) authentication without making token forwarding the default behavior. Documentation is updated to describe the new option and how to use it safely with --dry-run.

Changes:

  • Add --github-tokens wrapper option to bin/bwopencode and plumb it into sandbox environment construction.
  • Implement --dry-run redaction for forwarded GH_TOKEN_* values (printed as REDACTED).
  • Document the new bwopencode option and provide an example for per-command token selection.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
docs/bw-wrappers.md Documents the new bwopencode --github-tokens option and usage example.
bin/bwopencode Adds --github-tokens parsing and forwards GH_TOKEN_* into the sandbox with dry-run redaction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tacaswell

Copy link
Copy Markdown
Contributor

Do we want to add this to all of the wrappers?

@stuwilkins

Copy link
Copy Markdown
Contributor Author

Thomas A Caswell (@tacaswell) added!

Extends the --github-tokens flag added to bwopencode (cb57193) to
the remaining wrapper scripts, so gh(1) can be authenticated with
per-command token selection across all four sandboxed agent CLIs.

Assisted-by: opencode:claude-sonnet-5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 5 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is a less than good idea, but clearly there is a demand to let the robot touch gh.

@tacaswell
Thomas A Caswell (tacaswell) merged commit 8fca81c into NSLS2:main Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants