Skip to content

Conversation

@jmgilman
Copy link
Collaborator

@jmgilman jmgilman commented Jan 2, 2026

Motivation

  • Centralize fallback behavior for storage paths and base image selection so CLI commands behave consistently when no config is loaded.
  • Allow the --agent flag to be specified without an explicit value and validate agent names independently of a loaded config.
  • Reduce duplication and complexity in agent credential retrieval by consolidating provider metadata and error handling.

Description

  • Exported the default base image as DefaultBaseImage and updated Viper defaults and tests to use it instead of an unexported symbol.
  • Added defaultDataDir and resolveBaseImage helpers and wired them into initManager, logs and recreate flows so defaults come from a single place.
  • Simplified credential injection by introducing an agentAuthSpecs map and unified injectAuthToken logic, and enabled --agent to accept no option value via NoOptDefVal with sentinel handling.
  • Replaced config-dependent agent validation with package-level helpers (config.IsValidAgent / config.ValidAgentNames) and updated call sites accordingly.

Testing

  • Formatted modified files with gofmt to ensure style consistency and applied the changes to source and tests.
  • Updated unit tests to reference DefaultBaseImage where applicable but no automated go test run in this rollout.
  • No automated test failures were observed because the test suite was not executed as part of this change.

Codex Task

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 2, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
headjack bb7bed0 Commit Preview URL

Branch Preview URL
Jan 02 2026, 10:49 PM

@jmgilman jmgilman merged commit f90d7b6 into master Jan 2, 2026
2 checks passed
@jmgilman jmgilman deleted the codex/conduct-thorough-code-review-for-cli branch January 2, 2026 22:49
jmgilman added a commit that referenced this pull request Jan 3, 2026
Current behavior:
CLI commands used hardcoded paths and repetitive switch statements for agent authentication, with scattered default value resolution logic.

New behavior:
Centralized default resolution with helper functions, unified agent auth handling through a specification map, and consistent data directory path management.

Closes: #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants