[FEATURE]: Forward environment variables from client when attaching to server #6815

Open
opened 2026-02-16 18:05:20 -05:00 by yindo · 1 comment
Owner

Originally created by @SteffenDE on GitHub (Jan 19, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When running an opencode server with opencode serve it would be nice if the agent could access environment variables from clients:

MY_ENV_VAR=foo opencode attach http://localhost:4096

Currently, the agent won't be able to see MY_ENV_VAR.

Originally created by @SteffenDE on GitHub (Jan 19, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request When running an opencode server with `opencode serve` it would be nice if the agent could access environment variables from clients: ```bash MY_ENV_VAR=foo opencode attach http://localhost:4096 ``` Currently, the agent won't be able to see `MY_ENV_VAR`.
yindo added the discussion label 2026-02-16 18:05:20 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9292: Expose session context to child processes via environment variables

Both issues relate to making environment variables accessible to agents/processes in different contexts. Feel free to ignore if your specific case is different.

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #9292: Expose session context to child processes via environment variables Both issues relate to making environment variables accessible to agents/processes in different contexts. Feel free to ignore if your specific case is different.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6815