Skip to content

fix(cli): preserve existing agent settings with --model - #3677

Draft
devanshrj wants to merge 3 commits into
mainfrom
devansh/preserve-agent-model-settings
Draft

fix(cli): preserve existing agent settings with --model#3677
devanshrj wants to merge 3 commits into
mainfrom
devansh/preserve-agent-model-settings

Conversation

@devanshrj

Copy link
Copy Markdown
Contributor

Summary

  • treat an existing agent's persisted generation configuration as the baseline when startup combines --agent and --model
  • apply the selected model identity, provider-specific settings, and reasoning tier while preserving context window, max tokens, and temperature
  • clamp preserved caps to backend-reported model limits, with preset limits and backend validation as the fallback
  • rebuild destination provider settings instead of carrying incompatible provider-specific fields across providers
  • stop silently refreshing existing agents from model presets when no model override was requested

Fresh --new-agent --model creation and established interactive /model behavior continue to apply complete preset defaults. Same-handle reasoning tiers remain model-bearing updates, and --agent --model composes with both --conv default and --new conversation selection.

Verification

  • bun run check — all 12 checks passed
  • focused model/startup matrix — 113 passed, 0 failed
  • affected API/local update suites after final cleanup — 19 passed, 0 failed
  • isolated local non-inference CLI smoke — Sonnet to GPT-5.6 changed model/provider/reasoning while preserving 65,536 context, 4,096 max tokens, temperature 0.2, and the custom system prompt
  • Letta Cloud non-inference CLI smoke — verified the same persisted before/after state through the real API; disposable agent deleted and deletion verified

Compatibility

  • existing-agent CLI model overrides now preserve effective persisted caps/sampling values rather than replacing them with preset defaults
  • values above the destination catalog limit are clamped with a warning
  • missing catalog limits fall back to preset limits and backend validation
  • fresh-agent creation and interactive /model semantics are unchanged

@devanshrj
devanshrj marked this pull request as draft August 5, 2026 01:00
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