Skip to content

refactor(config): extract shared config resolution - #124

Merged
rgao-coreweave merged 1 commit into
mainfrom
109-03-config-extract
Jul 17, 2026
Merged

refactor(config): extract shared config resolution#124
rgao-coreweave merged 1 commit into
mainfrom
109-03-config-extract

Conversation

@rgao-coreweave

@rgao-coreweave rgao-coreweave commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

New src/config.ts shared by the CLI and daemon; resolution is defined once.

  • Project/API key/agent name resolvers move from cli.ts; resolveDaemonConfig, resolveTraceBaseUrl, and the fingerprint move from daemon.ts.
  • The project and API-key resolver twins collapse into one resolveFromEnvOrSettings.
  • missingConfig shared by status, restart, and runDaemon (was three inline copies).
  • cmdConfig drops a let-reassign and a whole-object cast.

Behavior note: an empty-string env var now falls through to settings instead of winning with a mislabeled source.

Test plan: npm run check; status / config show output unchanged

🤖 Generated with Claude Code

rgao-coreweave commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@drtangible drtangible left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

@rgao-coreweave
rgao-coreweave force-pushed the 109-03-config-extract branch from 1a97da0 to 2761356 Compare July 17, 2026 20:18
@rgao-coreweave
rgao-coreweave changed the base branch from 109-02-setup-spawn to graphite-base/124 July 17, 2026 20:28
Move the env-over-settings resolvers (project/API key/agent name, from
cli.ts) and resolveDaemonConfig/resolveTraceBaseUrl/fingerprint (from
daemon.ts) into src/config.ts; dedupe the resolver twins via
resolveFromEnvOrSettings and share missingConfig between status/restart
and runDaemon. cmdConfig loses a let-reassign and a whole-object cast.

Behavior note: an empty-string env var now falls through to settings
instead of winning with a mislabeled source.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rgao-coreweave
rgao-coreweave force-pushed the 109-03-config-extract branch from 2761356 to 7693513 Compare July 17, 2026 20:34
@rgao-coreweave
rgao-coreweave changed the base branch from graphite-base/124 to main July 17, 2026 20:34

rgao-coreweave commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jul 17, 8:36 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 17, 8:36 PM UTC: @rgao-coreweave merged this pull request with Graphite.

@rgao-coreweave
rgao-coreweave merged commit 2aaf71b into main Jul 17, 2026
6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants