Skip to content

feat(config): add config-reload to clear all session overrides#2819

Merged
tusharmath merged 1 commit intomainfrom
config-reload
Apr 3, 2026
Merged

feat(config): add config-reload to clear all session overrides#2819
tusharmath merged 1 commit intomainfrom
config-reload

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Apr 3, 2026

Summary

Replace the narrow model-reset command with a broader config-reload command that clears all session-scoped overrides — model, provider, and reasoning effort — restoring the global configuration in one step.

Context

The existing model-reset (mr) command only cleared _FORGE_SESSION_MODEL and _FORGE_SESSION_PROVIDER. Once reasoning effort was added as a third session override, users had no single command to return to a clean, config-driven state. The new config-reload (cr) command fills that gap, and the old aliases (model-reset / mr) are kept for backwards compatibility.

Changes

  • Renamed model-reset built-in command to config-reload with an updated description reflecting its expanded scope
  • Renamed _forge_action_model_reset_forge_action_config_reload in the shell plugin and extended it to also clear _FORGE_SESSION_REASONING_EFFORT
  • Declared _FORGE_SESSION_REASONING_EFFORT as a typed shell variable in config.zsh
  • Updated the dispatcher to route config-reload|cr|model-reset|mr to the new action (backwards-compatible aliases preserved)
  • Improved the informational messages to accurately describe what was cleared

Key Implementation Details

The dispatcher now matches four aliases (config-reload, cr, model-reset, mr) to the same handler, so existing shell history and muscle memory continue to work. The clear-all logic in _forge_action_config_reload checks all three session variables before deciding whether anything needs resetting, providing a more accurate "nothing to do" message.

Testing

# Start a shell session with the plugin loaded
source shell-plugin/forge.plugin.zsh

# Set session overrides
:model gpt-4o
:reasoning-effort high

# Verify overrides are active
echo $_FORGE_SESSION_MODEL          # gpt-4o
echo $_FORGE_SESSION_REASONING_EFFORT  # high

# Reset everything with the new command
:config-reload
# Expected: "Session overrides cleared — using global config"

# Verify all overrides are cleared
echo $_FORGE_SESSION_MODEL          # (empty)
echo $_FORGE_SESSION_PROVIDER       # (empty)
echo $_FORGE_SESSION_REASONING_EFFORT  # (empty)

# Verify backwards-compatible alias still works
:model gpt-4o
:model-reset
# Expected: same success message

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 3, 2026
@tusharmath tusharmath changed the title feat(config): add config-reload to reset session overrides feat(config): replace model-reset with config-reload to clear all session overrides Apr 3, 2026
@tusharmath tusharmath changed the title feat(config): replace model-reset with config-reload to clear all session overrides feat(config): add config-reload to clear all session overrides Apr 3, 2026
@tusharmath tusharmath merged commit d6d7c04 into main Apr 3, 2026
16 checks passed
@tusharmath tusharmath deleted the config-reload branch April 3, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant