Skip to content

Add layered settings with a /settings overlay - #9

Open
azeemshaik025 wants to merge 1 commit into
mainfrom
settings
Open

Add layered settings with a /settings overlay#9
azeemshaik025 wants to merge 1 commit into
mainfrom
settings

Conversation

@azeemshaik025

Copy link
Copy Markdown
Collaborator

Settings could only be changed by restarting with different ALAN_* env vars, and there was no way to see what was in force. This adds a settings file plus a /settings overlay to edit it live.

  • Resolves from defaults, global file, project file, then env — folded per field, so a project file setting one key does not reset the others
  • /settings edits either scope and marks where each value came from, and whether editing it there would actually take effect
  • Changes apply without a restart: the file is polled by mtime and the model rebinds in place
  • Mid-session model changes are recorded in the session log, so a resumed session continues on the model it ended with
  • Replaces the ad-hoc ALAN_* parsing in main.rs; ALAN_MODEL, ALAN_REASONING_EFFORT and the tool flags still work as the highest layer
  • No new third-party crates (serde was already a workspace dependency)

Two things a reviewer might ask about. bind now synthesises a ModelInfo for an id the catalog has not seen — without it only the model you launched with could ever bind, since the catalog holds exactly one entry. And ReasoningEffort gained Auto, which is omitted from the wire, so "let the model decide" is distinct from explicitly sending none.

Known gaps, deliberately left: a model id is not validated against the provider's catalog, and the overlay has nowhere to display a write error yet.

- Resolve settings from defaults, global file, project file, then env, with a
  per-field fold so a project file setting one key does not reset the others
- Add a /settings overlay to edit either scope live, showing where each value
  came from and whether editing it there would take effect
- Reload on file change and rebind the model without a restart
- Record mid-session model changes in the session log so a resumed session
  continues on the model it ended with
- Add ReasoningEffort::Auto so "let the model decide" is representable, and
  bind unknown model ids instead of refusing them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant