Skip to content

Commit e8f8ac8

Browse files
author
leestar
committed
fix(steer): fallback to sibling direct/DM lanes when slash lane has no active run
When /steer targets a slash-command session lane but no active embedded run exists there, check sibling direct and DM lanes for the same peer before giving up. This fixes the false "no active run" result when the user has an active run on the direct lane but /steer resolves to the slash lane. Fixes #81594 [AI-assisted]
1 parent 0b55317 commit e8f8ac8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎src/auto-reply/reply/commands-steer.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ function resolveSteerSessionId(params: {
6868
const entry = resolveStoredSessionEntry(params.commandParams, params.targetSessionKey);
6969
const sessionId = normalizeOptionalString(entry?.sessionId);
7070
if (!sessionId || !isEmbeddedPiRunActive(sessionId)) {
71+
// If the steer target is a slash lane but has no active run,
72+
// try sibling direct/DM lanes that may have the active run instead.
73+
if (params.targetSessionKey.includes(":slash:")) {
74+
const siblingKeys = [
75+
params.targetSessionKey.replace(":slash:", ":direct:"),
76+
params.targetSessionKey.replace(":slash:", ":dm:"),
77+
];
78+
for (const siblingKey of siblingKeys) {
79+
const siblingId = resolveActiveEmbeddedRunSessionId(siblingKey);
80+
if (siblingId) {
81+
return siblingId;
82+
}
83+
}
84+
}
7185
return undefined;
7286
}
7387
return sessionId;

0 commit comments

Comments
 (0)