fix(cli): strip virtual-LLM lifecycle fields from llm apply-doc YAML #64
Reference in New Issue
Block a user
Delete Branch "fix/llm-yaml-roundtrip-strip-lifecycle"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The `llm.smoke > round-trips yaml output → apply -f` smoke test failed after the virtual-LLM v1 deploy. `mcpctl get llm -o yaml` output started with `kind: public` (the new schema column) instead of `kind: llm` (the apply-doc envelope), because `toApplyDocs` spread the cleaned item after setting the kind, so the cleaned `kind` overwrote.
Fix: in `toApplyDocs`, when serialising the `llms` resource, drop the new lifecycle fields (`kind`, `status`, `lastHeartbeatAt`, `inactiveSince`, `providerSessionId`) before merging. They collide with the apply envelope and aren't apply-able anyway — they're derived runtime state owned by VirtualLlmService. Public-LLM round-trip is now byte-clean (those fields default to public/active). Virtual rows are created by the registrar, not via apply -f, so dropping them on output is the right call.
Test plan
🤖 Generated with Claude Code