Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

Sync environments with the current API spec: Model gateway key - #303

Merged
joetannenbaum merged 4 commits into
mainfrom
api-sync/environments
Nov 24, 2026
Merged

joetannenbaum merged 4 commits into
mainfrom
api-sync/environments

Conversation

@joetannenbaum

Copy link
Copy Markdown
Collaborator

The Cloud API spec changed. This lets an environment take a Model gateway key.

Findings fixed

Where What the spec says What the CLI did
UpdateEnvironmentRequest.model_gateway_key_id New. string | null: "The identifier of the Model gateway key to attach to the environment. From its next deployment, the environment receives the key as LARAVEL_CLOUD_MODEL_GATEWAY_API_KEY… Send null or an empty string to detach the key." Never sent. environment:update now has --model-gateway-key-id. An empty string detaches.
EnvironmentResource.relationships.modelGatewayKey, and modelGatewayKey in the include enum of GET /environments/{environment} New to-one relationship to a model_gateway_keys resource. Not requested and not on the DTO. EnvironmentsResource::withDefaultIncludes() now asks for it. Environment has modelGatewayKeyId, so --json and --fields can return it, and environment:update reports it as the previous value.

For review

  • The prompt is a text input. The spec has no endpoint that lists Model gateway keys, so there is nothing to pick from. Picking "Model gateway key" in the multiselect asks for the id, prefilled with the attached one. "Leave empty to detach" is the hint.

Left alone (uncertain)

  • serving on CreateApplicationRequest and CreateEnvironmentRequest: new. It is { mode: "process" | "static", root: string | null }, and both keys are required inside it. Neither the spec nor the public docs say what root means for each mode. Adding create options is also a design question, the same call Sync environments with the current API spec #300 made for basic auth on environment:create.
  • EnvironmentResource.attributes.serving: it is now required. The DTO already has it.
  • Still open from Sync environments with the current API spec #300: display_name, masking deploy_hook_url, the pull_request shape, and the internal-networking endpoints. Also still without commands: the edge-network ruleset and rule endpoints, and GET /environments/{environment}/queued-deployments. Those would be new commands, so they're proposals, not fixes.

Branch note

api-sync/environments still held #300's pre-squash commits. I merged them in with -s ours instead of force-pushing. Their content is identical to the squash commit on main, so this changes nothing in the diff.

Tests

  • New feature tests: --model-gateway-key-id sends the id, an empty string sends "", and environment:get --fields=modelGatewayKeyId returns the relationship id. The test also checks that modelGatewayKey is in the include query.
  • Run under PHP 8.4 with a dummy LARAVEL_CLOUD_TOKEN: 843 pass. RepoConfigTest ran separately without the token: 14/14 pass. PromptFallbackTest was skipped because it hangs in this container. PHPStan and Pint are clean.

Generated by Claude Code

claude and others added 4 commits November 20, 2026 21:38
Publish the environment's post-deploy command, HTTP basic auth state
and internal networking settings; let environment:update set the
post-deploy command and HTTP basic auth; keep a metric interval with no
sample as null instead of zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4Xyfgr8GKyqxCwmuSc
environment:update takes --model-gateway-key-id (empty string to detach),
and the Environment DTO exposes modelGatewayKeyId from the modelGatewayKey
relationship, which environment fetches now include.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4XemtA7LBFDSeyGK7H
@joetannenbaum
joetannenbaum merged commit 33a0026 into main Nov 24, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants