@f5-sales-demo/xcsh 20.8.4 → 20.8.5

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/xcsh",
4
- "version": "20.8.4",
4
+ "version": "20.8.5",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -61,13 +61,13 @@
61
61
  "dependencies": {
62
62
  "@agentclientprotocol/sdk": "1.3.0",
63
63
  "@mozilla/readability": "^0.6",
64
- "@f5-sales-demo/xcsh-stats": "20.8.4",
65
- "@f5-sales-demo/pi-agent-core": "20.8.4",
66
- "@f5-sales-demo/pi-ai": "20.8.4",
67
- "@f5-sales-demo/pi-natives": "20.8.4",
68
- "@f5-sales-demo/pi-resource-management": "20.8.4",
69
- "@f5-sales-demo/pi-tui": "20.8.4",
70
- "@f5-sales-demo/pi-utils": "20.8.4",
64
+ "@f5-sales-demo/xcsh-stats": "20.8.5",
65
+ "@f5-sales-demo/pi-agent-core": "20.8.5",
66
+ "@f5-sales-demo/pi-ai": "20.8.5",
67
+ "@f5-sales-demo/pi-natives": "20.8.5",
68
+ "@f5-sales-demo/pi-resource-management": "20.8.5",
69
+ "@f5-sales-demo/pi-tui": "20.8.5",
70
+ "@f5-sales-demo/pi-utils": "20.8.5",
71
71
  "@sinclair/typebox": "^0.34",
72
72
  "@xterm/headless": "^6.0",
73
73
  "ajv": "^8.20",
@@ -17,17 +17,17 @@ export interface BuildInfo {
17
17
  }
18
18
 
19
19
  export const BUILD_INFO: BuildInfo = {
20
- "version": "20.8.4",
21
- "commit": "297e0432f40ac41a3926217230d2ef6b3864eb26",
22
- "shortCommit": "297e043",
20
+ "version": "20.8.5",
21
+ "commit": "ed354637dc7586f58ebedbea98dea65b304e7122",
22
+ "shortCommit": "ed35463",
23
23
  "branch": "main",
24
- "tag": "v20.8.4",
25
- "commitDate": "2026-08-09T08:55:46Z",
26
- "buildDate": "2026-08-09T09:20:02.412Z",
24
+ "tag": "v20.8.5",
25
+ "commitDate": "2026-08-09T13:04:40Z",
26
+ "buildDate": "2026-08-09T13:30:24.105Z",
27
27
  "dirty": true,
28
28
  "prNumber": "",
29
29
  "repoUrl": "https://github.com/f5-sales-demo/xcsh",
30
30
  "repoSlug": "f5-sales-demo/xcsh",
31
- "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/297e0432f40ac41a3926217230d2ef6b3864eb26",
32
- "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v20.8.4"
31
+ "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/ed354637dc7586f58ebedbea98dea65b304e7122",
32
+ "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v20.8.5"
33
33
  };
@@ -1347,39 +1347,51 @@ export class AgentSession {
1347
1347
  return;
1348
1348
  }
1349
1349
 
1350
- if (outcome.safeToContinue) {
1351
- this.agent.abort();
1350
+ if (!outcome.safeToContinue) {
1351
+ this.#routingCoordinator.getStateMachine().setEscalationFloor(targetTier);
1352
+ return;
1352
1353
  }
1353
1354
 
1354
- this.#routingCoordinator.getStateMachine().setEscalationFloor(targetTier);
1355
- if (outcome.safeToContinue) {
1355
+ const previousTier = this.#routingCoordinator.getState().currentTier;
1356
+ const previousFloor = this.#routingCoordinator.getState().escalationFloor;
1357
+
1358
+ try {
1359
+ this.agent.abort();
1360
+
1361
+ this.#routingCoordinator.getStateMachine().setEscalationFloor(targetTier);
1356
1362
  this.#routingCoordinator.restoreState({ currentTier: targetTier });
1357
- }
1358
1363
 
1359
- await this.setModelRoutingSwitch(targetModel);
1360
- const effortMap = this.settings.get("routing.tierEffort") as Record<string, string> | undefined;
1361
- const { mapTierToEffort } = await import("../routing/effort");
1362
- const effort = mapTierToEffort(targetTier, effortMap);
1363
- this.setThinkingLevel(effort as any);
1364
-
1365
- this.#emitSessionEvent(
1366
- sanitizeRoutingEvent({
1367
- type: "routing_escalated",
1368
- epochId: `route-${Date.now()}-esc`,
1369
- reasons: reasons,
1370
- mode: routingMode,
1371
- effectiveTier: targetTier,
1372
- state: this.#routingCoordinator.getState(),
1373
- selectedModel: this.model ? `${this.model.provider}/${this.model.id}` : undefined,
1374
- escalated: true,
1375
- }),
1376
- ).catch(() => {});
1377
-
1378
- if (outcome.safeToContinue) {
1364
+ await this.setModelRoutingSwitch(targetModel);
1365
+ const effortMap = this.settings.get("routing.tierEffort") as Record<string, string> | undefined;
1366
+ const { mapTierToEffort } = await import("../routing/effort");
1367
+ const effort = mapTierToEffort(targetTier, effortMap);
1368
+ this.setThinkingLevel(effort as any);
1369
+
1370
+ this.#emitSessionEvent(
1371
+ sanitizeRoutingEvent({
1372
+ type: "routing_escalated",
1373
+ epochId: `route-${Date.now()}-esc`,
1374
+ reasons: reasons,
1375
+ mode: routingMode,
1376
+ effectiveTier: targetTier,
1377
+ state: this.#routingCoordinator.getState(),
1378
+ selectedModel: this.model ? `${this.model.provider}/${this.model.id}` : undefined,
1379
+ escalated: true,
1380
+ }),
1381
+ ).catch(() => {});
1382
+ } catch (err) {
1383
+ console.error("Escalation model swap failed", err);
1384
+ this.#routingCoordinator.restoreState({ currentTier: previousTier });
1385
+ if (previousFloor) {
1386
+ this.#routingCoordinator.getStateMachine().setEscalationFloor(previousFloor);
1387
+ } else {
1388
+ this.#routingCoordinator.getStateMachine().clearEscalationFloor();
1389
+ }
1390
+ } finally {
1379
1391
  this.#scheduleAgentContinue({ delayMs: 10 });
1380
1392
  }
1381
1393
  } catch (err) {
1382
- console.error("Escalation model swap failed", err);
1394
+ console.error("Escalation setup failed", err);
1383
1395
  }
1384
1396
  };
1385
1397
  this.#trackPostPromptTask(performEscalationModelSwap());