Done — I set this up in a fresh worktree and drafted the project plan.
/Users/tarunsachdeva/code/traces-worktrees/feat-namespace-settingsfeat/namespace-settingsdocs/projects/namespace-settings.mdI recommend using a dedicated namespaceSettings table (not adding config columns directly to namespaces), and handling sensitive values like OPENAI_API_KEY in a separate namespaceSecrets table (or secret-manager reference).
Why this is the safer fit for this repo:
api/convex/namespaces.ts:14 serves namespace profile data from namespaces on public paths.api/convex/internal/namespaces.ts:9 returns full namespace docs and is used broadly in auth/session flows.api/convex/services/traces.ts:125 and api/convex/services/traces.ts:166.api/convex/utils/ai.ts:60.So: keep namespaces as identity/profile, move configurable behavior to settings, and isolate secrets from general namespace reads.
If you want, I can now start Part 2 in this worktree and scaffold the schema + internal functions.
Great call. I started with the minimal setup for namespace-level provider keys only (no visibility setting).
docs/projects/namespace-settings.md.namespaceSettings table in api/convex/schema.ts with:
namespaceIdllmApiKeys (Record<string, string>)updatedBy, updatedAtapi/convex/internal/namespace_settings.ts:
getProviderApiKeysetProviderApiKeylistConfiguredProvidersapi/convex/internal/scheduled/traceSummary.tsapi/convex/utils/ai.ts (now accepts optional key override)api/convex/internal/test_helpers.tsapi/convex/reset.tsMinimal model recommendation (what we now have):
namespaces as identity/profile only.namespaceSettings row per namespace.llmApiKeys map keyed by provider name (openai, anthropic, etc.).Note:
I couldn’t run tests here because bun is unavailable in this environment.
If you want, next I can implement admin-only HTTP endpoints (GET/PATCH /v1/namespaces/:slug/settings) with masked responses so the settings page can manage keys safely.