Repository navigation
fix(daemon): refuse leases for providers without a registered runtime - #3773
Conversation
|
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 19 files
You’re at about 95% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The code in 0f84dd1 looks correct to me, and all 20 checks pass, but live validation is still missing: I ran no tests and did not run the provider integration suite or the fallow gate. I also did not check whether any out-of-tree caller allocates leases with arbitrary provider ids against a local daemon. Please run Not blocking, and you can take or leave these: the host admin route Would it be simpler to enforce the registered-provider rule where leases are admitted, for example a registry or admission option that holds the registered provider ids, instead of in one RPC handler? Then The three earlier inline threads on the docs wording, the lease test assertions and the credentials test are fixed at this commit, so you can resolve them: #3773 (comment), #3773 (comment) and #3773 (comment). Before merge, please decide whether the host admin route is covered or explicitly excluded, and add the CHANGELOG line. |
0f84dd1 to
c136996
Compare
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
You’re at about 96% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
e08f4bf to
1281279
Compare
|
Follow-up at Live validation. Real daemon from this worktree's build ( The daemon was stopped afterwards (pid 40161 gone). Step 8 is as far as I can take "succeeds once registered" without real provider credentials; a full success with a registered runtime is the existing fake-provider integration scenario ( Review items
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… exemptions Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…sal in the changelog Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…provider Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ut a lease registry handle Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1281279 to
b1f65c4
Compare
|
Rebased onto current main (picks up #3722 and #3764–#3766); the only conflict was the Live validation re-run on the rebased build (real daemon from this worktree, fresh state dir and The earlier comment still applies for the trim/malformed cases, the registered-runtime pass-through, and the explicit exclusion of |
|
The PR is ready at b1f65c4. The provider-id mismatch, the doc and help gaps, and both test gaps from the earlier review are now fixed. Not blocking: the trimmed-id test at lease-provider-credentials.test.ts:163 uses mismatched credentials, so it only fails through the provider string, and a case with a matching fingerprint and ' limrun ' that asserts allocations === 1 would cover the bug Cubic named. In lease.ts:84, the handler normalizes the provider id but allocateOrRenewLease still gets the raw scope and the registry normalizes it again, so building the normalized scope once and passing it to the asserts and to allocateOrRenewLease would drop the need for the explaining comment. Take or leave both. I did not re-run the live daemon validation or any tests. I accepted the transcripts in comments 6231802940 and 6231954375. The live run reached the registered-provider path only up to the BrowserStack env refusal after admission, so full success with a registered runtime rests on the fake-provider integration scenario, which I did not run. I also did not audit out-of-tree callers that allocate leases with arbitrary provider ids against a local daemon. The Cubic threads on the normalized id (#3773 (comment)), the exemption docs and help (#3773 (comment)), the lease test assertions (#3773 (comment)) and the credentials test mock (#3773 (comment)) are all fixed at this head, so you can resolve them. CI is still pending: both Smoke Tests jobs are queued and nothing has failed yet. The change touches the daemon lease_allocate admission, which smoke routes that allocate a lease without registering the provider runtime would cross. No conflicts. Once the Smoke Tests jobs finish green, this can merge. |
…ment * origin/main: refactor(daemon): publish a single package entrypoint (#3781) fix(daemon-client): wait for an acknowledged quiesce instead of killing the daemon (#3780) fix(daemon): refuse leases for providers without a registered runtime (#3773) # Conflicts: # packages/daemon/src/sessions/handlers/__tests__/lease.test.ts # src/daemon-client/daemon-client-ensure.ts
…refactor/daemon-runtime-no-process-globals * origin/refactor/host-environment: refactor(cli): resolve one transport per run and one host per MCP tool call; default the lease provider cwd to the bound host refactor(daemon): publish a single package entrypoint (#3781) fix(daemon-client): wait for an acknowledged quiesce instead of killing the daemon (#3780) fix(daemon): refuse leases for providers without a registered runtime (#3773)
Summary
leases.allocatewith aleaseProviderthat no registered runtime claims now fails before any lease is recorded:UNSUPPORTED_OPERATION,details.reason: 'provider-not-registered',details.provider,details.registeredProviders. Previously only the hard-coded required list was checked, so a plugin provider such astestmuon a daemon without the plugin recorded a lease with no device behind it.leaseProviderRequiringRuntimeinpackages/contracts/src/lease-scope.tsis the one classifier. Provider-less leases (including backend-only),proxyandcloud(newCLOUD_LEASE_PROVIDER, used bycloud-profile.ts) need no runtime; every other id must be registered.providerRuntimeRequiredIdsplumbing is removed from the lease handler, request chain and router. The list itself andcreateProviderDeviceRuntimeRequestProvidersare left for feat(plugins): plugin contract v2 and one provider registry #3767.plugins.mdandclient-api.mdname the reason.Closes #3748. Part of #3747.
Validation
pnpm check:affected --run --head 9923eec046: all runnable checks passed (exactCommit=true). Provider integration suite: 65 files pass, including atestmurefusal with no lease in the registry. Unit tests cover each exemption (provider-less, backend-only, proxy, cloud). Not device-facing.🤖 Generated with Claude Code