Skip to content

feat(plugin): add session stopping hook - #41811

Open
chrisalexandrepena wants to merge 1 commit into
anomalyco:devfrom
chrisalexandrepena:neuronzai-hooks
Open

feat(plugin): add session stopping hook#41811
chrisalexandrepena wants to merge 1 commit into
anomalyco:devfrom
chrisalexandrepena:neuronzai-hooks

Conversation

@chrisalexandrepena

@chrisalexandrepena chrisalexandrepena commented Aug 11, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #16626

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a plugin hook before a completed session goes idle. Plugins can append ordered context, which OpenCode persists as a hidden synthetic user turn before continuing the same loop. With no returned context, the existing terminal path is unchanged. Hook failures also leave the completed assistant response intact.

How did you verify your code works?

  • bun test test/session/prompt.test.ts --timeout 30000
  • bun test test/cli/run/run-process.test.ts --timeout 30000 -t "awaits external plugin dispose"
  • bun typecheck in packages/plugin and packages/opencode
  • full monorepo typecheck from the pre-push hook

Screenshots / recordings

Not applicable.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

[FEATURE]: add session.stopping plugin hook to allow re-entering the agent loop

1 participant