@dyyz1993/pi-coding-agent 0.74.44 → 0.74.46
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.
|
@@ -2164,11 +2164,17 @@ export class AgentSession {
|
|
|
2164
2164
|
await this.settingsManager.reload();
|
|
2165
2165
|
resetApiProviders();
|
|
2166
2166
|
await this._resourceLoader.reload();
|
|
2167
|
+
// Capture the old runner before _buildRuntime replaces it, so we can
|
|
2168
|
+
// invalidate it after the new runner is active. This ensures any
|
|
2169
|
+
// ExtensionContext captured from the old runner will throw on access
|
|
2170
|
+
// instead of silently returning stale data.
|
|
2171
|
+
const oldRunner = this._extensionRunner;
|
|
2167
2172
|
this._buildRuntime({
|
|
2168
2173
|
activeToolNames: this.getActiveToolNames(),
|
|
2169
2174
|
flagValues: previousFlagValues,
|
|
2170
2175
|
includeAllExtensionTools: true,
|
|
2171
2176
|
});
|
|
2177
|
+
oldRunner.invalidate("This extension ctx is stale after reload. Do not use the old ctx after await ctx.reload().");
|
|
2172
2178
|
const hasBindings = this._extensionUIContext ||
|
|
2173
2179
|
this._extensionCommandContextActions ||
|
|
2174
2180
|
this._extensionShutdownHandler ||
|