Skip to content

fix(protocol): declare model API-key editing contracts - #148093

Merged
obviyus merged 2 commits into
mainfrom
codex/model-key-protocol
Sep 14, 2026
Merged

obviyus merged 2 commits into
mainfrom
codex/model-key-protocol

Conversation

@obviyus

@obviyus obviyus commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Generated clients cannot describe requests or successful responses for the existing models.authSetApiKey method.

User Impact

Clients gain typed key-editing requests and results, including saved-with-refresh-warning responses. Malformed fields receive standard request-validation errors.

Why This Change Was Made

Canonical protocol schemas replace the handler's duplicate shape checks. Key persistence keeps its existing writer. The necessary schema and public exports add 23 lines; the typed handler adds seven. Regenerated workboard asset references account for its bundled protocol registry.

Evidence

The baseline generator omitted both definitions. The 151-case integration and compiled TypeScript/Swift consumers pass for the unchanged protocol patch. The final head also passes type, lint, protocol, and generated-asset checks. Exact tested source identities are retained with the proof.

Hosted CI fails only on the stale Docker fixture name introduced in #148074. The exact test fails identically on the CI base and merge; this PR changes none of its inputs. All other required checks passed.

Compatibility

Unknown request fields, empty agent selection, administrator scope, semantic key checks and refresh warnings remain supported. No method, protocol version or storage change. The stable release predates this method.

Consumers

Existing Models requests remain valid; generated Swift types now describe their wire fields.

Invalidation

Credential save still precedes the existing auth refresh.

Tests

Public validation, real persistence, invalid-input nonmutation, administrator access and saved-warning results.

Refs #144420.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M labels Sep 14, 2026
@obviyus
obviyus marked this pull request as ready for review September 14, 2026 08:31
@obviyus
obviyus requested a review from a team as a code owner September 14, 2026 08:31
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Sep 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 8:05 AM ET / 12:05 UTC (Revision 2).

ClawSweeper review

What this changes

Adds public request and response schemas, validators, generated Swift types, and regression coverage for existing model API-key editing, and refreshes Workboard’s bundled asset references.

Merge readiness

✅ Ready for maintainer review

The protocol declarations are still missing on current main, so this PR remains useful. No introduced correctness defect was found, and the protected maintainer label excludes automated closure.

Priority: P2
Reviewed head: c10010537929cf7af3d7f5dd33dae274d33644b4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused contract repair with meaningful boundary coverage and no supported blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-author exemption applies using the supplied member classification and verified repository write access. The reported Gateway persistence and compiled-client checks match the changed contract, but were not independently executed here; the patch does not materially change authority.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author exemption applies using the supplied member classification and verified repository write access. The reported Gateway persistence and compiled-client checks match the changed contract, but were not independently executed here; the patch does not materially change authority.
Evidence reviewed 8 items Current main still lacks the declarations: The inspected main schema moves directly from auth refresh to logout; its API-key handler still performs inline provider and key checks. The central protocol gap remains.
Compatible validation and unchanged persistence: The schema accepts nonblank provider/key strings, optional string agent selection, and unknown request fields. The handler retains provider normalization, existing agent resolution, the shared credential writer, and refresh-warning results; existing web and Android callers send compatible fields.
Permission and credential ownership remain unchanged: The registered method still requires operator.admin. The unchanged writer retains semantic key validation, reference-backed credential protection, binding checks, and model-selection preservation. The patch does not materially change authority or persisted formats.
Findings None None.
Security None None.

How this fits together

The Gateway receives model credential edits from clients and delegates persistence to the shared credential writer. Protocol schemas describe those requests and responses for validation and generated clients.

flowchart LR
  A[Models clients] --> B[Administrator permission check]
  B --> C[Protocol request validation]
  C --> D[Agent selection and credential writer]
  D --> E[Credential storage]
  E --> F[Auth refresh]
  F --> G[Typed success or saved warning]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +30, Tests +133, Other +44. Total +207 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 43 13 +30
Tests 3 133 0 +133
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 44 0 +44
Total 9 220 13 +207

Review metrics

Metric Value Why it matters
Protocol surface 2 schema declarations; 0 new RPC methods or configuration options The additions describe an existing operation rather than introduce another credential-editing API.

Technical review

Best possible solution:

Keep one canonical protocol definition for the existing credential-editing method while preserving its shared persistence owner and wire compatibility.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main implements the RPC but omits its request and result schemas from the canonical schema source consumed by generation. No generator or runtime tests were executed during this review.

Is this the best way to solve the issue?

Yes. The patch fills the canonical schema and generated-client gap, replaces duplicate shape checks, and leaves credential persistence with its existing owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7eb75ef60712.

Labels

Label justifications:

  • P2: Missing generated-client contracts are a bounded protocol defect without an established urgent runtime outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-author exemption applies using the supplied member classification and verified repository write access. The reported Gateway persistence and compiled-client checks match the changed contract, but were not independently executed here; the patch does not materially change authority.

Evidence

What I checked:

  • Current main still lacks the declarations: The inspected main schema moves directly from auth refresh to logout; its API-key handler still performs inline provider and key checks. The central protocol gap remains. (packages/gateway-protocol/src/schema/agents-models-skills.ts:343, 7eb75ef60712)
  • Compatible validation and unchanged persistence: The schema accepts nonblank provider/key strings, optional string agent selection, and unknown request fields. The handler retains provider normalization, existing agent resolution, the shared credential writer, and refresh-warning results; existing web and Android callers send compatible fields. (src/gateway/server-methods/models-auth-status.ts:437, c10010537929)
  • Permission and credential ownership remain unchanged: The registered method still requires operator.admin. The unchanged writer retains semantic key validation, reference-backed credential protection, binding checks, and model-selection preservation. The patch does not materially change authority or persisted formats. (src/gateway/methods/core-descriptors.ts:671, c10010537929)
  • Focused regression coverage: The new integration test uses the Gateway client and persisted credential store, checks accepted legacy request fields, rejects malformed and unknown-agent inputs, and exercises a read-only client's denial. Existing handler tests additionally validate successful responses with and without refresh warnings. These tests were inspected, not executed in this read-only review. (src/gateway/server-methods/models-auth-api-key.integration.test.ts:14, c10010537929)
  • Re-review continuity and generated assets: The prior completed review recorded no findings. Comparing its reviewed head with this head shows only Workboard's asset-reference refresh; the protocol patch is unchanged. The existing builder hashes bundled browser assets, including embedded workspace packages, which explains the manifest change. (extensions/workboard/openclaw.plugin.json:226, c10010537929)
  • Merged feature context and routing: The supplied GitHub context verifies fix(models): share API-key editing and removal #144420 as merged. Its commit patch contains the existing API-key handler and shared writer delegation; it does not supply this PR's missing protocol declarations. Current-main history also shows repeated related work by Ayaan Zaidi and Peter Steinberger. Some deeper local blame/history reads failed on unavailable objects; the relevant merged patch was inspected through GitHub. (src/gateway/server-methods/models-auth-status.ts:451, 09e2b15466e1)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • openclaw/openclaw-secops: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-14T08:56:27.156Z sha 68ccf55 :: needs maintainer review before merge. :: none

@obviyus

obviyus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 148093
head: c100105
run: 34831146124 attempt: 1
failed: checks-node-compact-small-19 job=103939976000 conclusion=failure
check: openclaw/ci-gate

@obviyus

obviyus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-admin-merge
pr: 148093
head: c100105
scope: owner-review

@obviyus
obviyus merged commit a7c6365 into main Sep 14, 2026
196 of 203 checks passed
@obviyus
obviyus deleted the codex/model-key-protocol branch September 14, 2026 12:06
@obviyus

obviyus commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @obviyus!

Proof: Registered Gateway requests persist valid keys and reject invalid input; TypeScript and Swift consumers compile, including saved-with-warning results.

  • Bug: Generated clients could not describe the existing API-key editing method.
  • Fix: Canonical request and result schemas now serve validation and client generation.
Before After
API-key method omitted from generated contracts Typed request and saved result, including refresh warnings

The missing Secops sign-off was waived by the explicit owner-review exception.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Declare the existing model API-key request and result for Gateway validation and generated clients. Preserve administrator scope, credential persistence, and saved-with-refresh-warning responses.

Validated through the registered Gateway with real persistence and rejected-input checks, 151 integration cases, and compiled TypeScript and Swift consumers.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. plugin: workboard rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant