Skip to content

fix: validate serverless agent model selections - #732

Merged
motatoes merged 2 commits into
mainfrom
fix/serverless-agent-model-validation
Sep 14, 2026
Merged

motatoes merged 2 commits into
mainfrom
fix/serverless-agent-model-validation

Conversation

@motatoes

@motatoes motatoes commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • compile exact static useModel() selections into immutable agent artifacts, including literal conditional branches
  • reject dynamic model expressions that cannot be enumerated at deployment time
  • derive the authoritative registry from the digest-checked artifact at the public edge instead of trusting request metadata
  • propagate and expose admitted model/default metadata through the deployment API

Consequential decisions and risks

  • Deployment is now the first validation boundary; an invalid exact identifier must not become a runtime downgrade.
  • Artifact derivation keeps the public edge authoritative but requires a coordinated managed-runtime rollout.
  • Existing artifacts without a registry remain representable as legacy deployments; the runtime PR owns fail-closed dispatch behavior.

Review map

  • cli/src/project.ts: static selection discovery and artifact registry
  • cli/src/dev.ts, cli/src/api.ts: deployment propagation and response types
  • cloudflare-workers/api-edge/src/managed_agents.ts: digest-checked registry extraction and public mapping
  • adjacent tests cover literals, conditionals, dynamic rejection, propagation, and malformed artifacts

Verification

  • CLI build passed
  • 84 CLI tests passed
  • 193 API-edge tests passed
  • mo-dev deployment response exposed exact Sonnet 5 metadata; an unavailable exact ID was rejected with HTTP 409 invalid_model_selection

Remaining gates

  • merge and roll out with the coordination and managed-runtime PRs
  • update public availability claims only after the complete slice ships

Related work

Mohamed Habib added 2 commits September 14, 2026 15:40
Compile exact static model selections into agent artifacts and reject dynamic selections that cannot be registered. Derive the authoritative registry from the digest-checked artifact at the public edge, propagate it through deployment registration, and expose the admitted registry/default in public responses. This makes invalid models fail at deployment instead of surfacing as runtime downgrades.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​opencomputer/​cli@​0.7.1 ⏵ 0.7.2N/AN/AN/AN/AN/A

View full report

@motatoes
motatoes merged commit dde6ec9 into main Sep 14, 2026
4 checks passed
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