feat(cli): inject resolvers into cmd_list - #195
Open
ecalifornica wants to merge 1 commit into
Open
Conversation
|
🔍 Preview deployed: https://92d73cea.toolpath.pages.dev |
ecalifornica
force-pushed
the
robert/config-cmd-list
branch
from
August 14, 2026 19:49
06c40e0 to
fc76de7
Compare
ecalifornica
commented
Aug 14, 2026
| } | ||
|
|
||
| pub fn run(command: PCommand, pretty: bool) -> Result<()> { | ||
| pub fn run(command: PCommand, pretty: bool, config: &crate::config::Config) -> Result<()> { |
Collaborator
Author
There was a problem hiding this comment.
&Config instead?
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.
Part of #184 (PR 3 of the plan there). Stacked on #193. path-cli only.
Why
The command modules convert one per PR, so each diff stays reviewable and a regression bisects to one command.
cmd_listconverts second: it is the next-smallest surface aftercmd_show, and it is the first command that constructs providers on emscripten, which forces theprovidersmodule to compile there. The module loses its target gate and keeps per-function gates onopencode_resolverandcursor_resolver, the two resolvers whose crates are absent from the emscripten dependency table. Every target then constructs resolvers through the same functions, and the gates sit exactly where the capability boundary is.What
run()passes&Configtocmd_p::run, which passes it tocmd_list::run. No otherpsubcommand takes it yet.cmd_listconstructs every conversation provider viawith_resolver(providers::*_resolver(config)). The pi arm chainswith_sessions_dirwhen--baseis given, so--basewins over the injected home. The git and github arms construct no provider and do not change.providerscompiles on emscripten:cmd_listcompiles there, and its claude/gemini/codex/copilot/pi arms construct providers.opencode_resolverandcursor_resolvercarry#[cfg(not(target_os = "emscripten"))]; the opencode and cursor crates are absent from the emscripten dependency table, and the matchingcmd_listarms bail on emscripten before any construction.configis used on every target inrun(), andConfig::home_diris used on emscripten. Their emscripten lint expectations (expect(unused_variables),expect(dead_code)) are gone.Behavior change
p list pi, Windows only: the CLI injectsConfig::home_dir(), which falls back to$USERPROFILE. The pi resolver's internal lookup reads$HOMEonly (pi: resolver home lookup ignores $USERPROFILE #192). With$HOMEunset,p list piresolves%USERPROFILE%\.pi\agent\sessions.Tests
cmd_listunit tests build managers from injected resolvers and call thelist_*helpers directly; therun_*signature change does not touch them.providerstests do not change. Assertions stay on paths fully determined by injected values.list_copilot_tsv_shows_sessionexercises the$COPILOT_HOMEvalue throughConfigandcopilot_resolverend to end.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.