singularity-forge/src/resources/extensions/remote-questions
Jeremy McSpadden 74c1736372 fix(remote-questions): empty-key entry in auth.json shadows valid Discord bot token (#2737)
* fix(remote-questions): empty-key entry in auth.json shadows valid Discord bot token

removeProviderToken() called auth.set(provider, { key: '' }) instead of
auth.remove(provider). Since AuthStorage.set() appends for api_key type
(deduplicating by exact key match), this inserted an empty-key entry at
index 0. Every credential lookup (.get(), .find()) matched the empty
entry first, shadowing valid tokens at later indices.

Fixes:
- remote-command.ts: use auth.remove() instead of auth.set() with empty key
- config.ts: hydrateRemoteTokensFromAuth .find() now requires non-empty key
- wizard.ts: loadStoredEnvKeys uses getCredentialsForProvider + .find()
  instead of .get() which returns creds[0]
- onboarding.ts: check existing tokens via .some() over full credentials
  array instead of .get() which only returns first entry
- key-manager.ts: filter empty-key entries in getAllKeyStatuses, add/remove/
  rotate provider pickers, and doctor env-conflict check

Tests: 3186 pass, 0 fail across full GSD test suite

* fix(config): ignore empty shadowing tool keys
2026-03-26 16:16:42 -06:00
..
config.ts fix(remote-questions): empty-key entry in auth.json shadows valid Discord bot token (#2737) 2026-03-26 16:16:42 -06:00
discord-adapter.ts refactor: extract shared HTTP client for remote-questions adapters (#1212) 2026-03-18 11:58:43 -06:00
extension-manifest.json feat: add extension manifest + registry for user-managed enable/disable (#1238) 2026-03-18 14:12:19 -06:00
format.ts feat: add Telegram as remote questions channel (#645) (#655) 2026-03-16 11:09:39 -06:00
http-client.ts refactor: extract shared HTTP client for remote-questions adapters (#1212) 2026-03-18 11:58:43 -06:00
manager.ts fix: improve RemotePromptRecord.ref type safety (#1041) 2026-03-17 18:33:08 -06:00
mod.ts fix: pause auto-mode when env variables needed instead of blocking (#1147) 2026-03-18 08:32:46 -06:00
notify.ts refactor: extract PER_REQUEST_TIMEOUT_MS to shared types (#1196) 2026-03-18 11:20:04 -06:00
remote-command.ts fix(remote-questions): empty-key entry in auth.json shadows valid Discord bot token (#2737) 2026-03-26 16:16:42 -06:00
slack-adapter.ts refactor: extract shared HTTP client for remote-questions adapters (#1212) 2026-03-18 11:58:43 -06:00
status.ts feat(gsd): activate matching skills in dispatched prompts (#1630) 2026-03-20 13:20:06 -06:00
store.ts feat(gsd): activate matching skills in dispatched prompts (#1630) 2026-03-20 13:20:06 -06:00
telegram-adapter.ts refactor: extract shared HTTP client for remote-questions adapters (#1212) 2026-03-18 11:58:43 -06:00
types.ts refactor: extract PER_REQUEST_TIMEOUT_MS to shared types (#1196) 2026-03-18 11:20:04 -06:00