Conversation
- Create opencode plugin for - Plugin scans on session starts - Tool evaluation on tool.execute.before - Temporarily allow tool execution via sage_approve - Permanently allow tool execution via sage_allowlist_add - Create unit, integration, and e2e tests
- insert plugin scan result at text.complete - update walkPluginFiles to also handle the case when installPath is a file
- Update instructions for install Opencode Plugin - fix linting issues
TommYDeeee
left a comment
There was a problem hiding this comment.
Thank you for this PR, really appreciate it! I have left few notes bellow. Once it is sorted it looks good!
Regarding the:
- Added E2E tests for the plugin, but they currently cannot pass due to an unaddressed upstream OpenCode bug
Do you expect this to be resolved and addressed in other PR (or here?) once it can be? For now those tests probably can be marked to be skipped.
|
Thanks, @TommYDeeee. I’ve addressed all of the review comments. I also found a workaround for the Please let me know if you have any further comments or suggestions. |
TommYDeeee
left a comment
There was a problem hiding this comment.
LGTM! Thanks, now just the small typo (nitpick) and it can be merged.
|
Oh right my bad. It is now fixed. |
vaclavbelak
left a comment
There was a problem hiding this comment.
Thank you very much for your contribution! I have to ask you to address a few issues, two of which are major.
Major:
- fragile handling of Sage's verdict via try/catch could lead to a security hole if the message changes
sage_approveis inferior to a properaskwhich seems to be supported by OpenCode
Minor:
- closing tag in the prompt/instructions
- Fix cache dir resolution on plugin-scan - Refactor E2E test structure to parse opencode output as JSON
Summary
tool.execute.beforeandexperimental.text.complete.sage_approve,sage_allowlist_add, andsage_allowlist_remove.Tests
v1.2.14(macOS15.6.1).opencode run --commandfails withcommand3.agenton 1.2.14 anomalyco/opencode#15150