Skip to content

Decide how to persist daemon defaults and supervisor selection #49

@shinpr

Description

@shinpr

Related: #41

Background

Issue #41 surfaced a separate configuration question around supervisor selection.

Today, the supervisor is selected as a daemon startup option:

galley daemon run --supervisor codex

That is reasonable for an explicit run, but it is awkward when the same daemon defaults should be used repeatedly. Galley may need a persistent config file for user-facing daemon defaults, probably under ~/.galley.

This should not mean exposing every internal daemon option. The config file should only cover public options that are already part of the daemon operation surface and make sense as persistent defaults.

Decision to make

Decide how Galley should persist daemon defaults, and decide whether supervisor selection belongs to daemon/global config or repository config.

Supervisor selection is the main scope question:

  • Today it is daemon startup state, so daemon/global config is the natural fit.
  • However, it may be better UX to choose a supervisor per repository, similar to executor selection.
  • If supervisor selection is repository-specific, environment.yaml may be the better place for it.

Possible daemon config scope

If Galley adds a persistent daemon config, the initial scope should probably be limited to public daemon options that are useful as durable defaults, for example:

daemon:
  supervisor: codex
  max_concurrent_tasks: 1
  max_concurrent_per_repo: 1
  poll_interval: 10s
  claim_ttl: 30m
  heartbeat_interval: 1m
  shutdown_timeout: 5m
  idle_timeout: 10m

Other public flags exist, but they may need separate treatment because they are control-path or per-invocation options: --root, --pid-file, --log-file, --once, --stop-timeout, --readiness-timeout, stop --force, and status --output.

Supervisor options

Option A: daemon/global config

Treat supervisor selection as daemon-level configuration.

In this model, the supervisor can be configured in the persistent daemon config together with other daemon defaults.

Option B: repository config

Treat supervisor selection as repository-level configuration.

In this model, the supervisor would be configured in environment.yaml, so different repositories can choose different supervisors.

If this direction is chosen, we also need to decide how to handle the existing daemon startup option:

  1. Stop supporting supervisor selection at daemon startup.
  2. Keep the daemon startup option for backward compatibility.
  3. Keep both, but make environment.yaml take precedence over the daemon startup option.

Desired outcome

Decide:

  • whether Galley should have a persistent config file for daemon defaults
  • which public daemon options belong in that config
  • whether supervisor selection is daemon/global configuration or repository configuration
  • if both CLI flags and config files can define supervisor selection, what the precedence rules are
  • how backward compatibility for the existing --supervisor option should work

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions