fix: restore plugin command execution and sessionOnly guard #280
+90
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR completes the v1.1.6 integration by fixing plugin command execution that was lost during the merge.
Changes from v1.1.6 Upstream Sync
Features
PermissionNextwith wildcard pattern matchingFixes
fix(grep): Stream ripgrep output line-by-line to prevent memory exhaustion on large codebases (PR fix(grep): stream ripgrep output to prevent memory exhaustion anomalyco/opencode#5432)fix: Show spinner indicator for running tool calls and subagent tasksfix(pwa): Lock viewport on iOS to prevent overscroll bounce in PWA standalone modefix(bedrock): Handle bundled AWS SDK export shapes from Bun with robust coalescing logicfix: Resolve TypeScript errors in theme.tsx and prompt.tsfix: Restore plugin command execution and sessionOnly guard (lost during merge)Plugin Command Fix Details
Restored two critical pieces of code lost during v1.1.6 merge:
Files Modified
packages/opencode/src/session/prompt.ts- Restored sessionOnly and plugin execution codescript/sync/fork-features.json- Documented feature to prevent future merge regressionsTesting
All tests pass including:
Command.get resolves plugin aliasesSessionPrompt.command executes plugin commandSessionPrompt.command publishes error on plugin failureSessionPrompt.command blocks session-only commands for missing sessionsBreaking Changes
None
Greptile Summary
Restores two critical plugin command features that were lost during the v1.1.6 upstream merge:
The implementation follows existing patterns with proper error handling, logging, and event publishing. The
fork-features.jsondocumentation prevents future merge regressions by documenting the code markers to preserve.Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant SessionPrompt participant Command participant Session participant Plugin participant Bus User->>SessionPrompt: command(input) SessionPrompt->>Command: get(command) Command-->>SessionPrompt: command info alt command.sessionOnly is true SessionPrompt->>Session: get(sessionID) alt Session not found Session-->>SessionPrompt: error SessionPrompt->>Bus: publish(Session.Event.Error) SessionPrompt-->>User: throw Error else Session found Session-->>SessionPrompt: session end end alt command.type === "plugin" SessionPrompt->>Plugin: list() Plugin-->>SessionPrompt: plugins[] loop for each plugin SessionPrompt->>Plugin: client() Plugin-->>SessionPrompt: client SessionPrompt->>Plugin: pluginCommand.execute() alt execution fails Plugin-->>SessionPrompt: error SessionPrompt->>Bus: publish(Session.Event.Error) SessionPrompt-->>User: throw error else execution succeeds SessionPrompt->>Session: messages({limit: 1}) Session-->>SessionPrompt: messages[] alt messages exist SessionPrompt->>Bus: publish(Command.Event.Executed) SessionPrompt-->>User: return last message else no messages SessionPrompt-->>User: return undefined end end end else command.type === "template" SessionPrompt->>SessionPrompt: process template SessionPrompt-->>User: return result end