Repository navigation
fix(cli): consumer-found DX fixes for chat, .env, doctor and eval - #663
Merged
Merged
Conversation
- lousho chat (and the scaffolded src/index.ts) print a failed turn with its error code, provider failure category, HTTP status and fix. - .env files saved with a UTF-8 BOM keep their first key (bin/lousho.js and the scaffold read the file, drop the BOM and parse with util.parseEnv; variables already set still win). - lousho doctor loads .ts/.js agent modules like lousho dev, fails on a missing key for the module's provider, pings OpenRouter at /api/v1/key (a rejected key fails), labels reachability-only pings, and prints PowerShell fix lines on Windows. Scaffolded npm run doctor targets src/agent.ts. - lousho eval's table shows scores of passing scored gates. - fallow: ignore the create-lousho-agent bin's ../dist import and main export. - Docs: Windows npx with an absolute .tgz path does nothing; use a relative path or a file: spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinuxDevil
force-pushed
the
fix/cli-dx-consumer
branch
from
October 16, 2026 20:46
6523112 to
40b7968
Compare
This was referenced Oct 16, 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.
Problem
A consumer run of the CLI found:
lousho chatprinted onlyerror: User not found.(an OpenRouter 401), dropping the error code, category, HTTP status and fix that docs/cli.md promises. The scaffoldedsrc/index.tshad the same issue..envsaved with a UTF-8 BOM (PowerShell 5.1Set-Content -Encoding utf8) silently lost its first key:process.loadEnvFilekeeps the BOM, so the variable came out as\uFEFFOPENROUTER_API_KEY.lousho doctor:doctor src/agent.tsfailed withLOUSHO_SPEC_UNSUPPORTED_FORMATand the wrong fix text. The scaffold'snpm run doctor(no path) exited 0 with the agent's key missing.--pingpassed with a bogus OpenRouter key because/modelsneeds no auth. Fix lines saidexport X=on Windows.lousho evaltable hid the scores of passing scored gates; they only showed up in--json.npx C:\abs\path\x.tgzsilently does nothing, and the docs didn't say so.Fix
errorevents are held until the run ends. The error that failed the run is printed from the run's rejection:error: <msg> (<category>, HTTP <status>), then[CODE] hint (docs). Other error events print with their code's help line. The scaffold'serrorTextdoes the same through the publicSDKErrorAPI..env:bin/lousho.jsand the scaffold read the file, strip a leading BOM and parse it withutil.parseEnv(Node >= 21.7; the engines floor is 22.19). Variables already set still win..ts/.jsmodules are imported the same waylousho devimports them (newagentModuleConfig()in devReload; the agent is not built). The doctor checks the module's model provider, so a missing key is a failure. The scaffold's doctor script is nowlousho doctor src/agent.ts. OpenRouter is pinged at/api/v1/key, a 401/403 is a failure, and a customOPENAI_BASE_URLping is labelled reachability-only. Fix lines use$env:X="..."on win32. An unsupported file type gets the right fix text..fallowrc.json: addedignoreUnresolvedImportsfor../dist/index.jsandignoreExportsfor create-lousho-agent'smain.Verification
.env, existing env wins), doctorCore (module loading, missing key fails, OpenRouter/key, reachability label, PowerShell fix, unsupported-format fix), templates, evalReport.npx tsc --noEmit,npm run lint,npm run docs:llms:checkandnpm run buildpass.npx vitest run src/clipasses: 536 tests.packages/create-lousho-agenttemplate e2e (real install, typecheck, tests) passes with the new template.lousho doctor agent.tswith a BOM.envloads the key from.env, loads the module, FAILs on the missing OpenRouter key with a PowerShell fix line, and exits 1.npx fallow dead-code: the two create-lousho-agent findings are gone. Still reported, and unrelated to this PR:@lousho/build-ai-agentas an unused dependency of apps/agent-forge. It looks specific to this worktree.npm run test:coverageon Windows: 1 failure, the timing-sensitivesrc/storage/sqlite/connection.test.tslock-contention test. It passes on its own (env-only, under load). Because of that failure no coverage file was written, so the fullnpm run fallowhealth run did not happen locally.🤖 Generated with Claude Code