@ccpocket/bridge 1.67.4 → 1.68.1

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/dist/websocket.js CHANGED
@@ -1620,9 +1620,6 @@ export class BridgeWebSocketServer {
1620
1620
  this.send(ws, this.buildPathNotAllowedError(additionalWritableRoots.deniedRoot));
1621
1621
  break;
1622
1622
  }
1623
- const cached = provider === "claude"
1624
- ? this.sessionManager.getCachedCommands(projectPath)
1625
- : undefined;
1626
1623
  const { sessionId, permissionMode: effectivePermissionMode, executionMode: effectiveExecutionMode, planMode: effectivePlanMode, usedFallback: autoFallbackUsed, } = provider === "claude"
1627
1624
  ? this.createClaudeSessionWithFallback({
1628
1625
  projectPath,
@@ -1687,6 +1684,7 @@ export class BridgeWebSocketServer {
1687
1684
  usedFallback: false,
1688
1685
  };
1689
1686
  const createdSession = this.sessionManager.get(sessionId);
1687
+ const cached = this.sessionManager.getCachedCommands(provider, createdSession?.worktreePath ?? projectPath);
1690
1688
  // Load saved session name from CLI storage (for resumed sessions)
1691
1689
  void this.loadAndSetSessionName(createdSession, provider, projectPath, msg.sessionId).then(() => {
1692
1690
  this.send(ws, this.buildSessionCreatedMessage({
@@ -3380,6 +3378,7 @@ export class BridgeWebSocketServer {
3380
3378
  : "default",
3381
3379
  });
3382
3380
  const createdSession = this.sessionManager.get(sessionId);
3381
+ const cached = this.sessionManager.getCachedCommands("codex", createdSession?.worktreePath ?? effectiveProjectPath);
3383
3382
  await this.loadAndSetSessionName(createdSession, "codex", effectiveProjectPath, sessionRefId);
3384
3383
  this.send(ws, this.buildSessionCreatedMessage({
3385
3384
  sessionId,
@@ -3394,6 +3393,23 @@ export class BridgeWebSocketServer {
3394
3393
  permissionMode: legacyPermissionMode,
3395
3394
  executionMode,
3396
3395
  planMode,
3396
+ ...(cached
3397
+ ? {
3398
+ slashCommands: cached.slashCommands,
3399
+ skills: cached.skills,
3400
+ ...(cached.skillMetadata
3401
+ ? { skillMetadata: cached.skillMetadata }
3402
+ : {}),
3403
+ apps: cached.apps,
3404
+ ...(cached.appMetadata
3405
+ ? { appMetadata: cached.appMetadata }
3406
+ : {}),
3407
+ plugins: cached.plugins,
3408
+ ...(cached.pluginMetadata
3409
+ ? { pluginMetadata: cached.pluginMetadata }
3410
+ : {}),
3411
+ }
3412
+ : {}),
3397
3413
  }));
3398
3414
  this.broadcastSessionList();
3399
3415
  this.debugEvents.set(sessionId, []);
@@ -3414,7 +3430,6 @@ export class BridgeWebSocketServer {
3414
3430
  break;
3415
3431
  }
3416
3432
  const claudeSessionId = sessionRefId;
3417
- const cached = this.sessionManager.getCachedCommands(resumeProjectPath);
3418
3433
  let pendingResumes = this.pendingClaudeResumeInputs.get(ws);
3419
3434
  if (!pendingResumes) {
3420
3435
  pendingResumes = new Map();
@@ -3469,6 +3484,7 @@ export class BridgeWebSocketServer {
3469
3484
  worktreeOptions: worktreeOpts,
3470
3485
  });
3471
3486
  const createdSession = this.sessionManager.get(sessionId);
3487
+ const cached = this.sessionManager.getCachedCommands("claude", createdSession?.worktreePath ?? resumeProjectPath);
3472
3488
  const finishResume = () => {
3473
3489
  this.send(ws, {
3474
3490
  ...this.buildSessionCreatedMessage({
@@ -5714,7 +5730,7 @@ export class BridgeWebSocketServer {
5714
5730
  sendCachedCommands(ws, sessionId, session) {
5715
5731
  // Restore command metadata when the original init/supported_commands event
5716
5732
  // has fallen out of the bounded in-memory history.
5717
- const cached = this.sessionManager.getCachedCommands(session.projectPath);
5733
+ const cached = this.sessionManager.getCachedCommands(session.provider, session.worktreePath ?? session.projectPath);
5718
5734
  if (!cached ||
5719
5735
  (cached.slashCommands.length === 0 &&
5720
5736
  cached.skills.length === 0 &&