fix(cli): strip virtual-LLM lifecycle fields from llm apply-doc YAML #64

Merged
michal merged 1 commits from fix/llm-yaml-roundtrip-strip-lifecycle into main 2026-04-27 13:47:20 +00:00
Owner

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

  • CLI: 437/437.
  • Smoke (after deploy): `llm.smoke > round-trips yaml output → apply -f` passes; `virtual-llm.smoke` still passes.

🤖 Generated with Claude Code

## Summary The \`llm.smoke > round-trips yaml output → apply -f\` smoke test failed after the virtual-LLM v1 deploy. \`mcpctl get llm <name> -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 - [x] CLI: 437/437. - [ ] Smoke (after deploy): \`llm.smoke > round-trips yaml output → apply -f\` passes; \`virtual-llm.smoke\` still passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
michal added 1 commit 2026-04-27 13:47:10 +00:00
fix(cli): strip virtual-LLM lifecycle fields from llm apply-doc YAML
Some checks failed
CI/CD / lint (pull_request) Successful in 55s
CI/CD / test (pull_request) Successful in 1m12s
CI/CD / typecheck (pull_request) Successful in 2m59s
CI/CD / smoke (pull_request) Failing after 1m44s
CI/CD / build (pull_request) Successful in 6m35s
CI/CD / publish (pull_request) Has been skipped
2a44f60785
The smoke test \`llm.smoke > round-trips yaml output → apply -f\` failed
after v1 of the virtual-LLM feature: \`mcpctl get llm <name> -o yaml\`
output now starts 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 item's \`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-doc
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 anyway). Virtual rows are
created by the registrar, not via apply -f, so dropping them on
output is the right call.

CLI suite: 437/437. Smoke will re-run against the live mcpd via
scripts/release.sh after merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
michal merged commit 700d1683c2 into main 2026-04-27 13:47:20 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: michal/mcpctl#64