fix(ralph-loop): bind selectSession to tui context, use sourceSessionID for tool inheritance, handle flag-only arguments, fix test provider mocks
This commit is contained in:
parent
daa0d48026
commit
590dc04be7
@ -11,7 +11,8 @@ const DEFAULT_PROMPT = "Complete the task as instructed"
|
|||||||
|
|
||||||
export function parseRalphLoopArguments(rawArguments: string): ParsedRalphLoopArguments {
|
export function parseRalphLoopArguments(rawArguments: string): ParsedRalphLoopArguments {
|
||||||
const taskMatch = rawArguments.match(/^["'](.+?)["']/)
|
const taskMatch = rawArguments.match(/^["'](.+?)["']/)
|
||||||
const prompt = taskMatch?.[1] || rawArguments.split(/\s+--/)[0]?.trim() || DEFAULT_PROMPT
|
const promptCandidate = taskMatch?.[1] ?? (rawArguments.startsWith("--") ? "" : rawArguments.split(/\s+--/)[0]?.trim() ?? "")
|
||||||
|
const prompt = promptCandidate || DEFAULT_PROMPT
|
||||||
|
|
||||||
const maxIterationMatch = rawArguments.match(/--max-iterations=(\d+)/i)
|
const maxIterationMatch = rawArguments.match(/--max-iterations=(\d+)/i)
|
||||||
const completionPromiseMatch = rawArguments.match(/--completion-promise=["']?([^"'\s]+)["']?/i)
|
const completionPromiseMatch = rawArguments.match(/--completion-promise=["']?([^"'\s]+)["']?/i)
|
||||||
|
|||||||
@ -67,7 +67,7 @@ export async function injectContinuationPrompt(
|
|||||||
tools = currentMessage?.tools
|
tools = currentMessage?.tools
|
||||||
}
|
}
|
||||||
|
|
||||||
const inheritedTools = resolveInheritedPromptTools(options.sessionID, tools)
|
const inheritedTools = resolveInheritedPromptTools(sourceSessionID, tools)
|
||||||
|
|
||||||
await ctx.client.session.promptAsync({
|
await ctx.client.session.promptAsync({
|
||||||
path: { id: options.sessionID },
|
path: { id: options.sessionID },
|
||||||
|
|||||||
@ -68,5 +68,5 @@ function getSelectSessionApi(client: unknown): SelectSessionApi | null {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return selectSessionValue as SelectSessionApi
|
return (selectSessionValue as Function).bind(tuiValue) as SelectSessionApi
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1281,7 +1281,7 @@ describe("disable_omo_env pass-through", () => {
|
|||||||
//#given
|
//#given
|
||||||
;(agents.createBuiltinAgents as any)?.mockRestore?.()
|
;(agents.createBuiltinAgents as any)?.mockRestore?.()
|
||||||
;(shared.fetchAvailableModels as any).mockResolvedValue(
|
;(shared.fetchAvailableModels as any).mockResolvedValue(
|
||||||
new Set(["quotio/claude-opus-4-6-thinking", "quotio/gemini-3-flash"])
|
new Set(["anthropic/claude-opus-4-6", "google/gemini-3-flash"])
|
||||||
)
|
)
|
||||||
|
|
||||||
const pluginConfig: OhMyOpenCodeConfig = {
|
const pluginConfig: OhMyOpenCodeConfig = {
|
||||||
@ -1314,7 +1314,7 @@ describe("disable_omo_env pass-through", () => {
|
|||||||
//#given
|
//#given
|
||||||
;(agents.createBuiltinAgents as any)?.mockRestore?.()
|
;(agents.createBuiltinAgents as any)?.mockRestore?.()
|
||||||
;(shared.fetchAvailableModels as any).mockResolvedValue(
|
;(shared.fetchAvailableModels as any).mockResolvedValue(
|
||||||
new Set(["quotio/claude-opus-4-6-thinking", "quotio/gemini-3-flash"])
|
new Set(["anthropic/claude-opus-4-6", "google/gemini-3-flash"])
|
||||||
)
|
)
|
||||||
|
|
||||||
const pluginConfig: OhMyOpenCodeConfig = {}
|
const pluginConfig: OhMyOpenCodeConfig = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user