@leanandmean/coding-agent 0.74.1-scramjet.21 → 0.74.1-scramjet.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2119,10 +2119,20 @@ export class AgentSession {
2119
2119
  }
2120
2120
  async reload() {
2121
2121
  const previousFlagValues = this._extensionRunner.getFlagValues();
2122
- await emitSessionShutdownEvent(this._extensionRunner, { type: "session_shutdown", reason: "reload" });
2122
+ // SCRAMJET-DIVERGENCE: the Scramjet builtin is a required product component, so reload must validate
2123
+ // the replacement loader before any irreversible runtime mutation. settingsManager.reload() runs first —
2124
+ // it commits fresh settings before the loader can throw, but the re-read is idempotent, so a failed reload
2125
+ // leaves the runtime itself untouched. It also runs first
2126
+ // because the loader's path resolution reads live settings (the loader defers its own settings/source-map
2127
+ // commit until after the builtin init succeeds, so on this path the shared manager is intentionally read
2128
+ // twice). resourceLoader.reload() then re-runs the required
2129
+ // builtin and throws RequiredBuiltinInitError on failure — before session_shutdown is emitted and before
2130
+ // resetApiProviders(). A throwing builtin therefore leaves the current runner, resources, and providers
2131
+ // intact and fires no session_shutdown; only a validated candidate proceeds to teardown and rebuild.
2123
2132
  await this.settingsManager.reload();
2124
- resetApiProviders();
2125
2133
  await this._resourceLoader.reload();
2134
+ await emitSessionShutdownEvent(this._extensionRunner, { type: "session_shutdown", reason: "reload" });
2135
+ resetApiProviders();
2126
2136
  this._buildRuntime({
2127
2137
  activeToolNames: this.getActiveToolNames(),
2128
2138
  flagValues: previousFlagValues,