docs: document intentional design decisions in atlas, todo-continuation, and delegation hooks
This commit is contained in:
parent
1199e2b839
commit
2b87719c83
@ -1,6 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Cross-platform check if a path is inside .sisyphus/ directory.
|
* Cross-platform check if a path is inside .sisyphus/ directory.
|
||||||
* Handles both forward slashes (Unix) and backslashes (Windows).
|
* Handles both forward slashes (Unix) and backslashes (Windows).
|
||||||
|
* Uses path segment matching (not substring) to avoid false positives like "not-sisyphus/file.txt"
|
||||||
*/
|
*/
|
||||||
export function isSisyphusPath(filePath: string): boolean {
|
export function isSisyphusPath(filePath: string): boolean {
|
||||||
return /\.sisyphus[/\\]/.test(filePath)
|
return /\.sisyphus[/\\]/.test(filePath)
|
||||||
|
|||||||
@ -20,6 +20,7 @@ export function createToolExecuteBeforeHandler(input: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check Write/Edit tools for orchestrator - inject strong warning
|
// Check Write/Edit tools for orchestrator - inject strong warning
|
||||||
|
// Warn-only policy: Atlas guides orchestrators toward delegation but doesn't block, allowing flexibility for urgent fixes
|
||||||
if (isWriteOrEditToolName(toolInput.tool)) {
|
if (isWriteOrEditToolName(toolInput.tool)) {
|
||||||
const filePath = (toolOutput.args.filePath ?? toolOutput.args.path ?? toolOutput.args.file) as string | undefined
|
const filePath = (toolOutput.args.filePath ?? toolOutput.args.path ?? toolOutput.args.file) as string | undefined
|
||||||
if (filePath && !isSisyphusPath(filePath)) {
|
if (filePath && !isSisyphusPath(filePath)) {
|
||||||
|
|||||||
@ -36,14 +36,15 @@ export async function handleSessionIdle(args: {
|
|||||||
|
|
||||||
log(`[${HOOK_NAME}] session.idle`, { sessionID })
|
log(`[${HOOK_NAME}] session.idle`, { sessionID })
|
||||||
|
|
||||||
const isBackgroundTaskSession = subagentSessions.has(sessionID)
|
const isBackgroundTaskSession = subagentSessions.has(sessionID)
|
||||||
const boulderState = readBoulderState(ctx.directory)
|
const boulderState = readBoulderState(ctx.directory)
|
||||||
const isBoulderSession = boulderState?.session_ids.includes(sessionID) ?? false
|
const isBoulderSession = boulderState?.session_ids.includes(sessionID) ?? false
|
||||||
|
|
||||||
if (!isBackgroundTaskSession && !isBoulderSession) {
|
// Continuation is restricted to boulder/background sessions to prevent accidental continuation in regular sessions, ensuring controlled task resumption.
|
||||||
log(`[${HOOK_NAME}] Skipped: not boulder or background task session`, { sessionID })
|
if (!isBackgroundTaskSession && !isBoulderSession) {
|
||||||
return
|
log(`[${HOOK_NAME}] Skipped: not boulder or background task session`, { sessionID })
|
||||||
}
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const state = sessionStateStore.getState(sessionID)
|
const state = sessionStateStore.getState(sessionID)
|
||||||
if (state.isRecovering) {
|
if (state.isRecovering) {
|
||||||
|
|||||||
@ -87,7 +87,7 @@ export async function executeSyncContinuation(
|
|||||||
tools: {
|
tools: {
|
||||||
...(resumeAgent ? getAgentToolRestrictions(resumeAgent) : {}),
|
...(resumeAgent ? getAgentToolRestrictions(resumeAgent) : {}),
|
||||||
task: allowTask,
|
task: allowTask,
|
||||||
call_omo_agent: true,
|
call_omo_agent: true, // Intentionally overrides restrictions - continuation context needs delegation capability even for restricted agents
|
||||||
question: false,
|
question: false,
|
||||||
},
|
},
|
||||||
parts: [{ type: "text", text: args.prompt }],
|
parts: [{ type: "text", text: args.prompt }],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user