Repository navigation
Commit 1bc98ba
fix(opencode): show MCP tool output in non-interactive run mode
The fallback() handler for MCP tools in `opencode run` only displayed the
tool name and input JSON via inline(), but never showed tool results.
This changes it to use block() with the tool output, matching the existing
bash() handler pattern.
Also fixes a race condition where the event loop was fire-and-forget
(loop().catch(...)) while the handler returned after sdk.session.prompt()
completed its HTTP request. This caused the process to exit before the
LLM finished generating, losing tool results and the final text response.
The loop promise is now properly awaited.
Fixes anomalyco#6604, anomalyco#13946
Co-Authored-By: Claude Opus 4.6 <[email protected]>1 parent 206d81e commit 1bc98ba
1 file changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
582 | 587 | | |
583 | 588 | | |
584 | 589 | | |
585 | | - | |
| 590 | + | |
586 | 591 | | |
587 | 592 | | |
588 | 593 | | |
| |||
606 | 611 | | |
607 | 612 | | |
608 | 613 | | |
| 614 | + | |
| 615 | + | |
609 | 616 | | |
610 | 617 | | |
611 | 618 | | |
| |||
0 commit comments