11c3da752c
default-mode (system-transform): -e5463e2dbintroduced auto-activation of ultrawork+ralph-loop, anddc2e082acthen skipped the ultrawork system prompt whenever ralph_loop was also enabled. Net effect: the keyword-detector still showed 'Default ultrawork mode enabled' to the user, but the first turn had none of the ultrawork behavior. Loop continuation kept the ultrawork prefix, so the contract was honored only on later iterations. - Drop the skip so the initial turn matches what the toast advertises. New matrix test pins all four (ultrawork, ralph_loop) combinations. multimodal-looker: - Prompt claimed 'read' and 'call_omo_agent' were available, but the look_at invocation runtime explicitly disables both via READ_ENABLED and createAgentToolAllowlist([]). Small VL models trusted the prompt and looped on rejected tool calls (#4116). - Rewrite the agent prompt to describe direct-attachment analysis and forbid tool/agent calls. Add a consistency test that extracts the prompt's 'available tools' claim and compares it against the configured allowlist. delegate-task (skill-resolver): -088693697filtered per-agent restricted skills at the skill tool and builtin agent prompt layers, but delegate-task itself happily injected whatever skill name a caller passed. A target agent could be force-fed a skill marked agent: oracle just by listing it in load_skills. - Thread the target agent through resolveSkills and silently filter skills whose definition.agent does not include it. Public skills with no restriction are unaffected. Regression test pins the bypass.
26 lines
985 B
TypeScript
26 lines
985 B
TypeScript
import type { DefaultModeConfig } from "../config/schema/default-mode"
|
|
|
|
const ULTRAWORK_MODE_TAG = "<ultrawork-mode>"
|
|
|
|
export function createSystemTransformHandler(
|
|
defaultMode?: DefaultModeConfig,
|
|
getUltraworkMessage?: (agentName?: string, modelID?: string) => string,
|
|
): (
|
|
input: { sessionID?: string; model: { id: string; providerID: string; [key: string]: unknown } },
|
|
output: { system: string[] },
|
|
) => Promise<void> {
|
|
return async (input, output): Promise<void> => {
|
|
if (!defaultMode?.ultrawork || !getUltraworkMessage) return
|
|
|
|
// Avoid re-injecting if the ultrawork prompt is already in the system prompt
|
|
// (e.g. after compaction the system prompt is rebuilt and this hook fires again)
|
|
if (output.system.some((part) => part.includes(ULTRAWORK_MODE_TAG))) return
|
|
|
|
const modelID = input.model?.id
|
|
const ultraworkMessage = getUltraworkMessage("sisyphus", modelID)
|
|
if (!ultraworkMessage) return
|
|
|
|
output.system.push(ultraworkMessage)
|
|
}
|
|
}
|