feat: expose plan metadata to plugins via question.asked event #7097

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

Originally created by @backnotprop on GitHub (Jan 21, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

Plugins currently cannot access the plan file content when intercepting the plan_exit tool's question dialog. The question.asked event only contains the session ID and question text.

Use Case

Plugins like Plannotator need to intercept the plan approval dialog to show an interactive plan review UI instead of a simple Yes/No dialog. To do this, they need access to:

  • The plan file path
  • The plan file content

Proposed Solution

Add an optional metadata field to the QuestionRequest schema that plan_exit can use to pass plan information to plugins.

// Plugin can then access:
event.properties.metadata?.planPath
event.properties.metadata?.planRelativePath  
event.properties.metadata?.planContent

Additional Context

This is for the experimental plan mode (OPENCODE_EXPERIMENTAL_PLAN_MODE=1).

Originally created by @backnotprop on GitHub (Jan 21, 2026). Originally assigned to: @thdxr on GitHub. ## Summary Plugins currently cannot access the plan file content when intercepting the `plan_exit` tool's question dialog. The `question.asked` event only contains the session ID and question text. ## Use Case Plugins like Plannotator need to intercept the plan approval dialog to show an interactive plan review UI instead of a simple Yes/No dialog. To do this, they need access to: - The plan file path - The plan file content ## Proposed Solution Add an optional `metadata` field to the `QuestionRequest` schema that `plan_exit` can use to pass plan information to plugins. ```typescript // Plugin can then access: event.properties.metadata?.planPath event.properties.metadata?.planRelativePath event.properties.metadata?.planContent ``` ## Additional Context This is for the experimental plan mode (`OPENCODE_EXPERIMENTAL_PLAN_MODE=1`).
Author
Owner

@backnotprop commented on GitHub (Jan 28, 2026):

ping chaching

@backnotprop commented on GitHub (Jan 28, 2026): ping chaching
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7097