[PR #13662] feat(plugin): pass sessionID and callID to shell.env hook input #14761

Open
opened 2026-02-16 18:19:31 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13662

State: open
Merged: No


Fixes #13661

What does this PR do?

Adds optional sessionID and callID fields to the shell.env hook input, for symmetry with other events + state correlation when using concurrent subagents.

The fields are optional because pty/index.ts has no session context. bash.ts and prompt.ts already have both values in scope -- just passing them through.

How did you verify your code works?

  • Confirmed ctx.sessionID and ctx.callID are in scope at bash.ts:166
  • Confirmed input.sessionID and part.callID are in scope at prompt.ts:1625
  • pty/index.ts unchanged -- fields are optional, undefined is correct there
  • Existing plugins unaffected -- new fields are additive on the input object
  • Logged from plugin
    {"type":"debug","timestamp":"2026-02-15T00:03:14.492Z","level":"debug","message":"[shell.env] cwd=opencode sessionID=ses_3a1643f0dffeF2LkERFvZ6xOMw callID=toolu_vrtx_012mf7oncgJQaP6qf13pEGGg"}
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13662 **State:** open **Merged:** No --- Fixes #13661 ### What does this PR do? Adds optional `sessionID` and `callID` fields to the `shell.env` hook input, for symmetry with other events + state correlation when using concurrent subagents. The fields are optional because `pty/index.ts` has no session context. `bash.ts` and `prompt.ts` already have both values in scope -- just passing them through. ### How did you verify your code works? - Confirmed `ctx.sessionID` and `ctx.callID` are in scope at `bash.ts:166` - Confirmed `input.sessionID` and `part.callID` are in scope at `prompt.ts:1625` - `pty/index.ts` unchanged -- fields are optional, undefined is correct there - Existing plugins unaffected -- new fields are additive on the input object - Logged from plugin ```{"type":"debug","timestamp":"2026-02-15T00:03:14.492Z","level":"debug","message":"[shell.env] cwd=opencode sessionID=ses_3a1643f0dffeF2LkERFvZ6xOMw callID=toolu_vrtx_012mf7oncgJQaP6qf13pEGGg"}```
yindo added the pull-request label 2026-02-16 18:19:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14761