refactor(cli): convert mcp list, auth, auth list, logout to effectCmd#25521
Merged
Conversation
0d503bf to
cc4e88b
Compare
kitlangton
added a commit
that referenced
this pull request
May 3, 2026
Three commands that used cmd() + WithInstance.provide — missed in the earlier conversion arc. Now on effectCmd: - agent.ts: AgentCreateCommand. AgentListCommand was already converted. Instance.project / Instance.worktree → ctx.* via InstanceRef. - providers.ts: 3 subcommands. - list: instance: false (only reads global Auth + ModelsDev). - login: instance: true (reads Plugin + Config — both project-scoped). - logout: instance: false (only Auth). - mcp.ts: 2 remaining subcommands (add + debug). Other 4 (list, auth, auth list, logout) already converted in #25521 to Stage 4 directly. - add: Instance.project / Instance.worktree → ctx.*. - debug: no Instance reads. All bodies wrapped in Effect.promise(async () => {...}) for byte-equivalent behavior. Internal AppRuntime.runPromise(...) calls preserved as-is — Stage 4 cleanup is optional follow-up. Drops imports: WithInstance, Instance.
kitlangton
added a commit
that referenced
this pull request
May 3, 2026
Three commands that used cmd() + WithInstance.provide — missed in the earlier conversion arc. Now on effectCmd: - agent.ts: AgentCreateCommand. AgentListCommand was already converted. Instance.project / Instance.worktree → ctx.* via InstanceRef. - providers.ts: 3 subcommands. - list: instance: false (only reads global Auth + ModelsDev). - login: instance: true (reads Plugin + Config — both project-scoped). - logout: instance: false (only Auth). - mcp.ts: 2 remaining subcommands (add + debug). Other 4 (list, auth, auth list, logout) already converted in #25521 to Stage 4 directly. - add: Instance.project / Instance.worktree → ctx.*. - debug: no Instance reads. All bodies wrapped in Effect.promise(async () => {...}) for byte-equivalent behavior. Internal AppRuntime.runPromise(...) calls preserved as-is — Stage 4 cleanup is optional follow-up. Drops imports: WithInstance, Instance.
oleksii-honchar
pushed a commit
to oleksii-honchar/better-opencode
that referenced
this pull request
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Four of the six
mcpsubcommands migrated toeffectCmd. Same mechanical conversion: handler body becomesEffect.fn("Cli.mcp.<name>")with nativeyield*for service calls.Also drops the
AppRuntime.runPromisewrappers from the helper functionslistState()andauthState()— they now return Effects directly. No leftoverawait AppRuntime.runPromise(...)shims.Commits
refactor(cli): convert mcp list to effectCmd— also convertslistState()from async-runPromise wrapper to plain Effect.refactor(cli): convert mcp auth list to effectCmd— convertsauthState()similarly.refactor(cli): convert mcp logout to effectCmd— dropsAppRuntime.runPromiseforMcpAuth.Service.useandMCP.Service.usecalls.refactor(cli): convert mcp auth to effectCmd— biggest of the four; preserves the try/finally around the bus unsubscribe inside the Effect.gen body.Effect on
WithInstance.provideFour callers gone from
mcp.ts. Two remain (McpAddCommand,McpDebugCommand) — saved for the next batch since they're the bigger handlers.Test plan
bun run typecheckclean