Skip to content

fix(cli): forward version conditions for provider updates - #2

Draft
dimakis wants to merge 1 commit into
mainfrom
feat/provider-update-cas
Draft

dimakis wants to merge 1 commit into
mainfrom
feat/provider-update-cas

Conversation

@dimakis

@dimakis dimakis commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

Controllers that read a provider version cannot preserve that read boundary through provider update: the CLI currently sends resource_version=0 and permits a concurrent change to be overwritten. Add --expected-resource-version VERSION and forward the nonzero version to the gateway’s existing compare-and-swap.

Related Issue

No issue required: localized CLI bug fix forwarding the gateway’s existing optimistic-lock field. This supports Mitzo’s explicitly enrolled credential replacement flow in dimakis/mitzo#773.

Changes

  • Reject zero or malformed versions at argument parsing, and reject zero from direct library callers.
  • Preserve existing behavior when the optional flag is omitted. Version conflicts propagate without automatic retry against a newer version.
  • Cover CLI parsing, request forwarding, matching-version updates and stale-version rejection with synthetic gRPC fixtures. Update provider docs, architecture and CLI skill guidance.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated: full cargo test -p openshell-cli --locked passes 513 tests; the 51-test provider integration suite passes.
  • E2E tests added/updated (not applicable to CLI field forwarding; no configured gateway, credentials or model calls used)

mise run ci was attempted; its existing test:e2e-parity shell fixture fails on macOS BSD sed (invalid command code f). The CLI tests and full pre-commit checks pass separately. No installation or deployment changed.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated

Signed-off-by: dimakis <dimitri.saridakis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant