Skip to content

CoderAIProvider: check the key list on a key-less sync PATCH, and report key changes during a resend #268

Closed

Description

@ThomasK33

Two follow-ups from the review of #265, for the dormant CoderAIProvider controller (#154). Neither is a blocker: both fail safe.

  1. Check the key list when a sync PATCH sends no key. If a spec edit re-arms the provider and someone rotates its key in the Coder dashboard between the controller's GET and a PATCH that sends no key, the controller marks the generation applied without looking at the answer's keys. The next reconcile then reports KeyChangedExternally (stalled, zero writes), instead of the re-armed reconcile restoring the key. The fix: compare the answer's key list with status.credential.keyID before setting appliedGeneration. Review thread: 🤖 feat: sync CoderAIProvider drift, key rotation and kill switches #265 (comment)
  2. Report a dashboard key change during a pending resend. While status.credential.resendAttemptTime is set, the key kill switch is skipped, so a key that someone changes in the dashboard during that window is overwritten with the Secret's value without a report.

Both go into plan row A5b, before the activation PR (A7).

Refs #154


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

  1. ThomasK33 commented on Oct 13, 2026

    @ThomasK33
    MemberAuthor

    Two more follow-ups from the round-4 review of #265 (head 6a7811ea). Neither is a blocker, so the review-round cap defers them here:

    1. Keep a rejected create remembered across the site-owner check. After a non-retryable 4xx and a confirming 404, a failing requireSiteOwner (Coder unavailable, or the operator user is not a site owner yet) returns CoderUnavailable or ConfirmingCreate, and the ConfirmingRejectedCreate reason is lost. Once the owner check passes, the same rejected create is sent once more. Coder rejects it again with the same 4xx: one extra request, nothing created. Review thread: 🤖 feat: sync CoderAIProvider drift, key rotation and kill switches #265 (comment)
    2. Log a mismatched sync answer. checkAIProviderAnswer turns an assertion failed: answer mismatch (wrong ID, name or type in a read by ID) into a CoderAnswerMismatch stall. That follows plan 4.1 item 8 and the shipped CoderTemplateTest pattern (waitOnWrongAnswer), but unlike that pattern it does not log the error. Add the error log, and decide in that PR whether the read-by-ID path must instead return the error. Review thread: 🤖 feat: sync CoderAIProvider drift, key rotation and kill switches #265 (comment)

    Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions