Merge pull request #863 from sgwannabe/fix/keyword-detector-skip-background-tasks
fix(keyword-detector): skip keyword detection for background task sessions
This commit is contained in:
commit
5cb5dbef42
@ -72,12 +72,11 @@
|
|||||||
"empty-message-sanitizer",
|
"empty-message-sanitizer",
|
||||||
"thinking-block-validator",
|
"thinking-block-validator",
|
||||||
"ralph-loop",
|
"ralph-loop",
|
||||||
"preemptive-compaction",
|
|
||||||
"compaction-context-injector",
|
"compaction-context-injector",
|
||||||
"claude-code-hooks",
|
"claude-code-hooks",
|
||||||
"auto-slash-command",
|
"auto-slash-command",
|
||||||
"edit-error-recovery",
|
"edit-error-recovery",
|
||||||
"sisyphus-task-retry",
|
"delegate-task-retry",
|
||||||
"prometheus-md-only",
|
"prometheus-md-only",
|
||||||
"start-work",
|
"start-work",
|
||||||
"sisyphus-orchestrator"
|
"sisyphus-orchestrator"
|
||||||
@ -2134,14 +2133,6 @@
|
|||||||
"auto_resume": {
|
"auto_resume": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"preemptive_compaction": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"preemptive_compaction_threshold": {
|
|
||||||
"type": "number",
|
|
||||||
"minimum": 0.5,
|
|
||||||
"maximum": 0.95
|
|
||||||
},
|
|
||||||
"truncate_all_tool_outputs": {
|
"truncate_all_tool_outputs": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
@ -2234,9 +2225,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"dcp_for_compaction": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
15
bun.lock
15
bun.lock
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"configVersion": 1,
|
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
"": {
|
"": {
|
||||||
"name": "oh-my-opencode",
|
"name": "oh-my-opencode",
|
||||||
@ -31,13 +30,13 @@
|
|||||||
"typescript": "^5.7.3",
|
"typescript": "^5.7.3",
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"oh-my-opencode-darwin-arm64": "0.0.0",
|
"oh-my-opencode-darwin-arm64": "3.0.0-beta.8",
|
||||||
"oh-my-opencode-darwin-x64": "0.0.0",
|
"oh-my-opencode-darwin-x64": "3.0.0-beta.8",
|
||||||
"oh-my-opencode-linux-arm64": "0.0.0",
|
"oh-my-opencode-linux-arm64": "3.0.0-beta.8",
|
||||||
"oh-my-opencode-linux-arm64-musl": "0.0.0",
|
"oh-my-opencode-linux-arm64-musl": "3.0.0-beta.8",
|
||||||
"oh-my-opencode-linux-x64": "0.0.0",
|
"oh-my-opencode-linux-x64": "3.0.0-beta.8",
|
||||||
"oh-my-opencode-linux-x64-musl": "0.0.0",
|
"oh-my-opencode-linux-x64-musl": "3.0.0-beta.8",
|
||||||
"oh-my-opencode-windows-x64": "0.0.0",
|
"oh-my-opencode-windows-x64": "3.0.0-beta.8",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import type { PluginInput } from "@opencode-ai/plugin"
|
|||||||
import { detectKeywordsWithType, extractPromptText, removeCodeBlocks } from "./detector"
|
import { detectKeywordsWithType, extractPromptText, removeCodeBlocks } from "./detector"
|
||||||
import { log } from "../../shared"
|
import { log } from "../../shared"
|
||||||
import { isSystemDirective } from "../../shared/system-directive"
|
import { isSystemDirective } from "../../shared/system-directive"
|
||||||
import { getMainSessionID, getSessionAgent } from "../../features/claude-code-session-state"
|
import { getMainSessionID, getSessionAgent, subagentSessions } from "../../features/claude-code-session-state"
|
||||||
import type { ContextCollector } from "../../features/context-injector"
|
import type { ContextCollector } from "../../features/context-injector"
|
||||||
|
|
||||||
export * from "./detector"
|
export * from "./detector"
|
||||||
@ -37,6 +37,13 @@ export function createKeywordDetectorHook(ctx: PluginInput, collector?: ContextC
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip keyword detection for background task sessions to prevent mode injection
|
||||||
|
// (e.g., [analyze-mode]) which incorrectly triggers Prometheus restrictions
|
||||||
|
const isBackgroundTaskSession = subagentSessions.has(input.sessionID)
|
||||||
|
if (isBackgroundTaskSession) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const mainSessionID = getMainSessionID()
|
const mainSessionID = getMainSessionID()
|
||||||
const isNonMainSession = mainSessionID && input.sessionID !== mainSessionID
|
const isNonMainSession = mainSessionID && input.sessionID !== mainSessionID
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user