fix(atlas): restrict boulder continuation to sessions in boulder session_ids
Main session was unconditionally allowed through the boulder session guard, causing continuation injection into sessions not part of the active boulder. Now only sessions explicitly in boulder's session_ids (or background tasks) receive boulder continuation, matching todo-continuation-enforcer behavior.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin"
|
||||
import { getPlanProgress, readBoulderState } from "../../features/boulder-state"
|
||||
import { getMainSessionID, subagentSessions } from "../../features/claude-code-session-state"
|
||||
import { subagentSessions } from "../../features/claude-code-session-state"
|
||||
import { log } from "../../shared/logger"
|
||||
import { HOOK_NAME } from "./hook-name"
|
||||
import { isAbortError } from "./is-abort-error"
|
||||
@@ -43,13 +43,11 @@ export function createAtlasEventHandler(input: {
|
||||
const boulderState = readBoulderState(ctx.directory)
|
||||
const isBoulderSession = boulderState?.session_ids.includes(sessionID) ?? false
|
||||
|
||||
const mainSessionID = getMainSessionID()
|
||||
const isMainSession = sessionID === mainSessionID
|
||||
const isBackgroundTaskSession = subagentSessions.has(sessionID)
|
||||
|
||||
// Allow continuation if: main session OR background task OR boulder session
|
||||
if (mainSessionID && !isMainSession && !isBackgroundTaskSession && !isBoulderSession) {
|
||||
log(`[${HOOK_NAME}] Skipped: not main, background task, or boulder session`, { sessionID })
|
||||
// Allow continuation only if: session is in boulder's session_ids OR is a background task
|
||||
if (!isBackgroundTaskSession && !isBoulderSession) {
|
||||
log(`[${HOOK_NAME}] Skipped: not boulder or background task session`, { sessionID })
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user