fix: restore agent mentions and child permission auto-accept

Sends tagged agents as OpenCode agent parts
Auto-accepts pending child-session permissions from parent sessions
This commit is contained in:
Bohdan Triapitsyn
2026-05-14 15:30:10 +03:00
parent 34fde831eb
commit 5313494e5a
2 changed files with 80 additions and 5 deletions
+4
View File
@@ -67,6 +67,7 @@ function routeMessage(params: {
providerID: string
modelID: string
agent?: string
agentMentionName?: string
variant?: string
inputMode?: "normal" | "shell"
files?: Array<{ type: "file"; mime: string; url: string; filename: string }>
@@ -133,6 +134,7 @@ function routeMessage(params: {
modelID: params.modelID,
text: params.content,
agent: params.agent,
agentMentions: params.agentMentionName ? [{ name: params.agentMentionName }] : undefined,
variant: params.variant,
files: params.files,
additionalParts: params.additionalParts,
@@ -785,6 +787,7 @@ export const useSessionUIStore = create<SessionUIState>()((set, get) => ({
providerID,
modelID,
agent: effectiveDraftAgent,
agentMentionName,
variant,
inputMode,
files,
@@ -860,6 +863,7 @@ export const useSessionUIStore = create<SessionUIState>()((set, get) => ({
providerID,
modelID,
agent: effectiveAgent,
agentMentionName,
variant,
inputMode,
files,