feat: resolve embedding credentials natively from the OS keyring - #220
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 5:59 PM ET / 21:59 UTC. ClawSweeper reviewWhat this changesAdds explicit OS keyring credentials for embedding commands, semantic search, and diagnostics, with cancellable background initialization and unchanged environment defaults. Merge readiness✅ Ready for maintainer review This PR provides a distinct capability absent from main and v0.14.1. No blocking correctness or security defect was found; the MEMBER-authored contribution also remains protected from automated closure. Priority: P2 Review scores
Verification
How this fits togetherDiscrawl turns archived Discord messages and search queries into vectors through configurable embedding providers. This change supplies provider credentials and lets background capture continue while credential initialization waits or retries. flowchart TD
A[Embedding configuration] --> B{Credential source}
B --> C[Environment variable]
B --> D[Selected OS keyring item]
C --> E[Embedding provider]
D --> E
F[Archived messages and search queries] --> E
E --> G[Stored vectors and semantic search]
D --> H[Background initialization wait or retry]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep keyring selection explicit, preserve environment and credential-free configurations, and reuse the existing provider transport with bounded background initialization. Do we have a high-confidence way to reproduce the issue? Not applicable: this adds a credential-source capability rather than repairing a defined existing contract; source inspection confirms the capability is absent from main. Is this the best way to solve the issue? Yes: the explicit opt-in adapter uses existing keyring and provider APIs while preserving defaults, and the asynchronous lookup addresses blocking initialization without changing capture ownership. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 66fbb8fb51b0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Additional instructions
Keep Allow edits from maintainers enabled.
What Problem This Solves
Fixes an issue where users running Discrawl under a service manager need an external credential-loading process for embeddings even though Discord bot credentials already support the OS keyring. Requiring an environment export makes an otherwise native capture/embedding service harder to operate.
Why This Change Was Made
Add explicit
api_key_source = "keyring"selection with service/account fields, using the existing go-keyring dependency and Crawlkit's existing per-provider API-key option. The embedding commands, semantic queries, live worker, and doctor use the selected source. Absent fields preserve environment-based behavior without unexpected keyring prompts or fallback.Live provider initialization shares one pending lookup. Locked keyring prompts cannot block capture or worker cancellation, and unavailable credentials pause work without consuming attempts. Initialization retries after one minute; successful providers retain the key until restart. Keyring API keys do not undergo Discord bot-token normalization.
User Impact
Operators can run Discrawl directly under launchd or another service manager with both credentials resolved natively. Existing environment-based and credential-free provider configurations continue working. Keyring values are not written to configuration, process arguments, status, or the environment. Raw credential lookup errors and probe failures are not exposed in diagnostics.
Evidence