Skip to content

[bug] fix plugin reload and session meta patching#125

Merged
shayne-snap merged 1 commit into
mainfrom
fix/reload-plugin-disabled-config
May 25, 2026
Merged

[bug] fix plugin reload and session meta patching#125
shayne-snap merged 1 commit into
mainfrom
fix/reload-plugin-disabled-config

Conversation

@shayne-snap
Copy link
Copy Markdown
Contributor

Summary

Fix two state handling bugs in Whale:

  • return ApplyLoadedConfig errors from plugin disabled-config reloads instead of silently updating runtime plugin state from invalid config
  • introduce SessionMetaPatch so TotalCostUSD and TurnCount can be explicitly reset to zero without losing the existing partial-patch semantics

Root Cause

reloadPluginDisabledConfig ignored the error from ApplyLoadedConfig, unlike the skill reload path. PatchSessionMeta used numeric zero as the sentinel for "not provided", which made it impossible to patch cost or turn count back to zero.

Validation

  • go test ./internal/session ./internal/app
  • make test
  • git diff --check
  • manual TUI smoke with ./bin/whale: /plugins surfaced invalid ui.view_mode and /memory remained available after the failed reload; a normal turn wrote session meta with turn_count: 1 and cost

@shayne-snap shayne-snap changed the title [codex] fix plugin reload and session meta patching [bug] fix plugin reload and session meta patching May 25, 2026
@shayne-snap shayne-snap force-pushed the fix/reload-plugin-disabled-config branch from dd40b74 to c1cb750 Compare May 25, 2026 04:37
@shayne-snap shayne-snap marked this pull request as ready for review May 25, 2026 04:38
@shayne-snap shayne-snap merged commit dbae7ea into main May 25, 2026
2 checks passed
@shayne-snap shayne-snap deleted the fix/reload-plugin-disabled-config branch May 25, 2026 04:40
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