Repository navigation
Description
Problem
On 2026-10-25 the laptop's OpenCode sessions failed on the meta provider with 401 invalid_api_key, even though ~/.local/share/opencode/auth.json held the correct funded key. Root cause: agent-shell-env (BASH_ENV env.sh, __ase_load META_API_KEY) loads the key from /run/secrets/agent-auth/muse-sdk-token (fallback ~/.config/muse/api-key), and the OpenChamber server process carried that env value, overriding auth.json. Both files held a stale key (sha256 prefix 7d4f5006).
Hot-fix applied 2026-10-25 (live, verified)
Both secret files were replaced with the funded key (Bitwarden + 1Password item meta.api-key-funded, sha256 prefix 6b1ea8ee) and openchamber.service was restarted; laptop sessions then answered on meta/muse-wonder-1.0, content-verified.
The gap
The sops source in this repo — nixos/agent-auth/ — still encrypts the OLD key. Any secrets regeneration or laptop reboot restores the stale /run/secrets/agent-auth/muse-sdk-token and the 401s return.
Fix
- Re-encrypt the agent-auth secret with the current funded key from the vault (
meta.api-key-funded). - After the next regeneration/reboot, verify the deployed file's sha256 prefix is
6b1ea8eeand that a laptop OpenCode session answers on meta/muse-wonder-1.0. - Fold into the laptop declarative-module cleanup so the imperative hot-fix doesn't drift again.
Key values are referenced by name/hash prefix only — never paste the key into this issue, a commit, or chat.
Acceptance criteria
- The agent-auth secret in
nixos/agent-auth/(sops) is re-encrypted with the current funded key (vault itemmeta.api-key-funded, referenced by name only — the key value never appears in a commit, issue, or chat). - After a secrets regeneration or laptop reboot, the deployed
/run/secrets/agent-auth/muse-sdk-tokenhas sha256 prefix6b1ea8ee(not the stale7d4f5006). - A laptop OpenCode session on the
metaprovider (meta/muse-wonder-1.0) answers successfully after that regeneration/reboot, content-verified. - The imperative hot-fix is folded into the laptop declarative-module cleanup so the secret source cannot drift stale again.
Activity
dezren39 commentedon Oct 26, 2026
Intake review
Still live (verified this run): the hot-fix described in the issue was applied to the live secret files only; no merged PR since rotates the sops source in
nixos/agent-auth/, so a regeneration/reboot still restores the stale key (sha256 prefix7d4f5006) and the 401s return. Not closed. Acceptance criteria appended to the body this pass.Related: the 2026-10-25 laptop
meta-provider 401 incident this issue was filed from; vault itemmeta.api-key-funded(referenced by name only).Notes / risks: priority/high and
security-adjacent— this is secret handling. The rotation itself is a vault-access task for Drew/Muse with the vault open, not a sweep-automation task: never paste the key into an issue, commit, or chat, and verify by sha256 prefix only (6b1ea8eegood,7d4f5006stale). Effort is small (s) once vault access is in hand; the blocker is access, not work.Suggested approach: re-encrypt the agent-auth sops secret from the vault item, regenerate/deploy, then verify the deployed file's prefix and a live laptop session on meta/muse-wonder-1.0; fold the source into the declarative-module cleanup so the hot-fix cannot drift again.
🤖 Fleet monitor intake enrichment — labels normalized, acceptance criteria appended, and
meta/enrichedapplied this pass.fix(nixos): re-mirror bws sops with rotated muse.sdk-token (funded Me…
dezren39 commentedon Oct 26, 2026
Rotation at the source — done (2026-10-26, laptop batch). Keeping this open for the two residuals below.
What was done
muse.sdk-tokenstill held the stale key (verified by hash only:7d4f5006). Updated it vault-to-vault frommeta.api-key-funded; it now hashes to6b1ea8ee. This was the true source: the sops mirror is generated from bws, so the stale value kept re-encrypting itself.secrets/sops/common/bws.yamlwithlib/bws-to-sops.shon the laptop (full mirror, 95 secrets; no existing keys dropped). Merged as PR fix(nixos): re-mirror bws sops with rotated muse.sdk-token (funded Meta key) #969 (merge commitd0709ae9; checks green: flake evaluation, treefmt, CodeRabbit). Decryptingmuse.sdk-tokenfrom the merged file verifies at sha256 prefix6b1ea8ee.7d4f5006, exactly as this issue predicted. Re-patched the live file to the funded key (verified6b1ea8ee, owner/mode restored) and relaunched the OpenCode server under the corrected environment; the server process env now carries the funded key (hash-verified).Residuals
invalid_api_keyis gone; a verification session on meta/muse-wonder-1.0 against the laptop server now returns 402billing_not_configured("Billing verification failed… your team needs to resolve a billing issue first", team_id 1073226932208501). That is Meta account state, resolvable only in the Meta billing console — flagged to Drew separately. The session-answers acceptance criterion is blocked on that, not on this rotation.7 remaining items
dezren39 commentedon Nov 2, 2026
Triage verdict against current main 2f62ce6 (no secret values read or decrypted — structure and git history only):
Repo-side rotation is done. PR #969 (merge d0709ae, in main) rotated muse.sdk-token in secrets/sops/common/bws.yaml; PR #1320 (merged 2026-10-27) re-synced the mirror after the meta key renames; HEAD still carries muse.sdk-token plus both renamed meta.*.api-key entries. Consumers unchanged: nixos/agent-auth/default.nix:52 still maps agent-auth/muse-sdk-token to bws key muse.sdk-token, and agent-shell-env still loads META_API_KEY from that path. No follow-up fix packet enqueued — there is no remaining repo-side code change.
What remains is not queue work (matches Drew's 2026-10-26 note, which deliberately kept this open): (1) laptop nixos-rebuild switch to a generation containing the rotated mirror, otherwise a reboot restores the stale key; (2) the Meta 402 billing_not_configured on the funded key, resolvable only in the Meta billing console. Both need Drew/laptop-operator action, not a worker packet.
Queue labels resynced to queued; leaving open per Drew's standing call.
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 3, 2026
🤖 Agent note · triaged
d0709ae9) rotatedmuse.sdk-tokeninsecrets/sops/common/bws.yaml; PR Re-sync bws sops mirror after meta key renames #1320 (merged 2026-10-27, merge1bf2afb2) re-synced the mirror after the Meta key renames. No merged PR since has changed that path, and the issue itself records that the rerotation was hash-verified at the funded prefix.billing_not_configured. Neither is executable as a repository code change.dezren39 commentedon Nov 3, 2026
🤖 Agent note · triaged