@adhdev/daemon-core 0.9.82-rc.162 → 0.9.82-rc.164

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.162",
3
+ "version": "0.9.82-rc.164",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4088,24 +4088,36 @@ export class DaemonCommandRouter {
4088
4088
  const sessionId = typeof args?.targetSessionId === 'string' ? args.targetSessionId.trim()
4089
4089
  : typeof args?.sessionId === 'string' ? args.sessionId.trim() : '';
4090
4090
  if (!sessionId) return { success: false, error: 'targetSessionId required' };
4091
+ // Fetch both lookups up front. We used to bail with "Session not
4092
+ // found" when sessionRegistry forgot the SID (auto-cleanup,
4093
+ // daemon restart with the session not yet restored, etc), which
4094
+ // hid the coordinator-side metadata even though the
4095
+ // coordinator-registry still has it. Now we return whichever
4096
+ // side we have. The dashboard renders "no coordinator-specific
4097
+ // prompt" only when *neither* side knows the session.
4091
4098
  const target = this.deps.sessionRegistry.get(sessionId);
4092
- if (!target) return { success: false, error: 'Session not found', sessionId };
4093
- const adapter = this.deps.cliManager.findAdapter(target.providerType, { instanceKey: sessionId })?.adapter;
4099
+ const coord = getCoordinatorForSession(sessionId);
4100
+ if (!target && !coord) return { success: false, error: 'Session not found', sessionId };
4101
+ const adapter = target
4102
+ ? this.deps.cliManager.findAdapter(target.providerType, { instanceKey: sessionId })?.adapter
4103
+ : undefined;
4094
4104
  const runtimeMeta = (adapter && typeof (adapter as any).getRuntimeMetadata === 'function')
4095
4105
  ? (adapter as any).getRuntimeMetadata()
4096
4106
  : undefined;
4097
- const coord = getCoordinatorForSession(sessionId);
4098
- const providerMetaForSession = this.deps.providerLoader.resolve?.(target.providerType) || this.deps.providerLoader.getMeta(target.providerType);
4107
+ const providerType = target?.providerType || coord?.cliType || '';
4108
+ const providerMetaForSession = providerType
4109
+ ? this.deps.providerLoader.resolve?.(providerType) || this.deps.providerLoader.getMeta(providerType)
4110
+ : undefined;
4099
4111
  return {
4100
4112
  success: true,
4101
4113
  session: {
4102
4114
  sessionId,
4103
- providerType: target.providerType,
4115
+ providerType,
4104
4116
  providerName: providerMetaForSession?.name,
4105
- transport: target.transport,
4106
- workspace: (target as any).workspace,
4107
- spawnedAtMs: (target as any).spawnedAtMs,
4108
- providerSessionId: (target as any).providerSessionId,
4117
+ transport: target?.transport,
4118
+ workspace: (target as any)?.workspace || coord?.workspace,
4119
+ spawnedAtMs: (target as any)?.spawnedAtMs || coord?.startedAt,
4120
+ providerSessionId: (target as any)?.providerSessionId,
4109
4121
  runtimeMetadata: runtimeMeta,
4110
4122
  },
4111
4123
  coordinator: coord ? {