PR 3: purge legacy pi 0.67 wiring from cua-cli - #24
Conversation
Delete the dead pre-harness source files (agent.ts, agent-prompt.ts,
old models.ts, config.ts, old sessions.ts, skills.ts, old named-sessions.ts,
old action/runner.ts, old output/jsonl.ts) now that the harness paths from
PR 1 and PR 2 cover every CLI surface. Drop @mariozechner/*, the
@onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori} provider
packages, and smol-toml from packages/cua-cli/package.json so npm ls on
cua-cli no longer mentions any of them.
Remove the --config-profile flag, the cua config init|show subcommand, and
the now-dead configProfile plumbing through StartNamedSessionOptions /
NamedSessionMetadata. Update HELP, the cua-cli README (env-var auth, no
TOML config, provider:model refs), and the package description to match.
Drop the deleted-package tsconfig references from packages/cua-cli/tsconfig.json.
Acceptance per docs/cua-cli-harness-migration.md PR 3: npm ls cua-cli has
no removed packages; full monorepo build + cua-cli vitest suite are green.
rgarcia
left a comment
There was a problem hiding this comment.
Review — PR 3 (legacy purge)
Verified independently on the branch:
- Full monorepo build green (
npm run build, with the zig 0.15.2 toolchain installed the same way thecli-unitCI job does). npm test --workspace @onkernel/cua-cli→ 33/33 (7 files, incl. the 4 ptywright TUI scenarios,PTYWRIGHT_REQUIRED=1).npm test --workspace @onkernel/cua-ai→ 88/88;npm test --workspace @onkernel/cua-agent -- --exclude '**/*.live.test.ts'→ 28/28.- Acceptance criterion:
npm ls --workspace @onkernel/cua-clishows none of@mariozechner/*,@onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori},smol-toml.smol-tomlis gone from the lockfile entirely;@mariozechner/pi-{ai,agent-core}remain in the lock only as optional peers of the deprecated provider workspaces, which PR 4 deletes. npm ci --dry-runclean; GitHub CI green (integration/agent-e2eskipped because the PR is draft — expected per the workflow condition).- No remaining imports of any deleted module and no references to the dropped packages anywhere under
packages/cua-cli; no edits underpackages/agentorpackages/ai.
Plan adherence: matches the migration doc's PR 3 section. The deviations beyond the literal file list — dropping the dead config_profile/configProfile plumbing in harness-named-sessions.ts, two stale doc comments, and the tsconfig.json references cleanup — all fall under the plan's "any now-dead code" clause. Old named-session metadata files still parse (readNamedSession is a plain JSON.parse; the extra field is ignored, and since the parsed object is re-serialized whole by recordTranscriptPath, an old file's config_profile even survives rewrites). Behavioral contracts (action exit codes, jsonl schema incl. schema_version, session flags, named-session lifecycle) are untouched by this diff and covered by the existing suites.
Findings
- minor — root
README.mdquickstart (~line 113–114) still documentscua config init("# either set up a config file…"). With this PR merged, that invocation no longer hits a subcommand: the positionals fall through to interactive mode and start a TUI run with the prompt "config init". The plan's PR 3 bullet ("update … README (… removedcua config)") arguably covers this line even though the root README workspace table/diagram are PR 4 scope. Cheap fix: drop those two quickstart lines in this PR; otherwise make sure PR 4 picks them up (the quickstart's bare-id model examples, e.g.--model claude-opus-4-7, could move toprovider:modelrefs in the same pass — they still resolve while unambiguous, so that part is cosmetic). - nit —
.agents/skills/update-models/reference/{discover-models,native-action-probe}.tsstill read~/.config/cua/config.tomlas a Yutori-key fallback. Standalone reference scripts, nothing breaks; flagging so PR 4's "references under docs/ and skills/" sweep doesn't miss them (they live under.agents/skills/, notskills/).
No blockers or majors — approving as-is; finding 1 is fine to fold into PR 4 if preferred.
The subcommand was removed in this PR; the documented command would now fall through to interactive mode and start a TUI run with the literal prompt "config init".
|
Addressed:
|
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR is for To monitor this PR anyway, reply with |
Summary
Third PR of the cua-cli →
CuaAgentHarnessmigration (seedocs/cua-cli-harness-migration.md, PR 3).PR 1 wired the non-interactive surface onto the harness; PR 2 rebuilt the
interactive TUI on it. With every CLI surface now on the new wiring, this PR
deletes the pre-harness pi-0.67 code path and drops the deprecated packages
from
packages/cua-cli/package.json.Deleted source files
All replaced by the harness equivalents already merged in PRs 1 and 2:
src/agent.ts(pi 0.67Agentassembly)src/agent-prompt.ts(replaced byharness.prompt(text, { images })plusthe screenshot helper in
action/harness-runner.ts)src/models.ts(replaced bysrc/harness-models.tsover the cua-ai catalog)src/config.ts(TOML config; replaced by env-var auth +--thinking)src/sessions.ts(legacySessionManagerglue; replaced bysrc/harness-sessions.tsoverJsonlSessionRepo)src/skills.ts(legacy pi-coding-agent skill loader; replaced bysrc/harness-skills.ts)src/named-sessions.ts(legacycua-translator.browserSession.openglue;replaced by
src/harness-named-sessions.tsover@onkernel/sdk)src/action/runner.ts(legacy pi 0.67 action runner; replaced bysrc/action/harness-runner.ts)src/output/jsonl.ts(legacy jsonl sink; replaced bysrc/output/harness-jsonl.ts)Dropped dependencies
From
packages/cua-cli/package.json:@mariozechner/pi-agent-core,@mariozechner/pi-ai,@mariozechner/pi-coding-agent,@mariozechner/pi-tui@onkernel/cua-translator,@onkernel/cua-openai,@onkernel/cua-anthropic,@onkernel/cua-gemini,@onkernel/cua-tzafon,@onkernel/cua-yutorismol-tomlAlso removed the matching
referencesentries frompackages/cua-cli/tsconfig.json. The provider packages remain in themonorepo until PR 4 deletes them.
CLI surface changes
cua config init|showsubcommand and the--config-profileflag. Configuration is now environment variables only (cua-ai key
conventions +
KERNEL_API_KEY+<PROVIDER>_BASE_URL).--helptext to drop config refs, refresh the env-var table, andlist recommended
provider:modelrefs explicitly.configProfileplumbing throughStartNamedSessionOptionsandNamedSessionMetadata. New named-sessionmetadata files will no longer include
config_profile; existing filesparse fine (the field is unused).
packages/cua-cli/README.mdto reflect env-var auth,
provider:modelrefs, and the removedcua configsubcommand.
Test plan
npm run build— full monorepo build greennpm test --workspace @onkernel/cua-cli— 33/33 tests passnpm test --workspace @onkernel/cua-ai— 88/88 tests passnpm test --workspace @onkernel/cua-agent -- --exclude '**/*.live.test.ts'—28/28 tests pass
npm ls --workspace @onkernel/cua-clishows no@mariozechner/*,@onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori}, orsmol-tomlentries (acceptance criterion from the plan)Out of scope (PR 4)
packages/cua-{translator,openai,anthropic,gemini,tzafon,yutori}workspaces themselves and the root
package.json/tsconfig.json/README.mdreferences to them.npm deprecateof published provider packages (manual follow-up).Note
Medium Risk
Breaking change for users who relied on TOML profiles and bare model ids without
provider:prefixes; runtime behavior should match harness paths already shipped in PRs 1–2.Overview
PR 3 removes the legacy pi 0.67 / per-provider wiring from
@onkernel/cua-clinow that all surfaces run throughCuaAgentHarness(PRs 1–2).Deleted code:
agent.ts,agent-prompt.ts,models.ts,config.ts,sessions.ts,skills.ts,named-sessions.ts,action/runner.ts, andoutput/jsonl.ts— each superseded byharness-*/cli-harnessmodules.Dependencies:
package.jsonnow depends only on@earendil-works/pi-coding-agent,@earendil-works/pi-tui,@onkernel/cua-agent,@onkernel/cua-ai, and@onkernel/sdk. Removed@mariozechner/pi-*, all@onkernel/cua-{translator,openai,anthropic,gemini,tzafon,yutori}, andsmol-toml.tsconfig.jsonproject references to those provider packages are dropped.User-facing:
cua config init|showand--config-profileare gone; auth and base URLs are environment variables only. Help and READMEs documentprovider:modelrefs (e.g.openai:gpt-5.5) and--thinking. Named-session metadata no longer writesconfig_profile(old files still parse).Docs: Root and
packages/cua-cli/README.mdquickstart dropscua config initin favor of env vars.Reviewed by Cursor Bugbot for commit d9aa32c. Bugbot is set up for automated code reviews on this repo. Configure here.