@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/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +21 -9
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -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
|
-
|
|
4093
|
-
|
|
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
|
|
4098
|
-
const providerMetaForSession =
|
|
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
|
|
4115
|
+
providerType,
|
|
4104
4116
|
providerName: providerMetaForSession?.name,
|
|
4105
|
-
transport: target
|
|
4106
|
-
workspace: (target as any)
|
|
4107
|
-
spawnedAtMs: (target as any)
|
|
4108
|
-
providerSessionId: (target as any)
|
|
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 ? {
|