fix(tui): route permission replies to session directory (#30851)
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
parent
b375890745
commit
3cf1cef7fe
@@ -1285,7 +1285,10 @@ export function Session() {
|
|||||||
</scrollbox>
|
</scrollbox>
|
||||||
<box flexShrink={0}>
|
<box flexShrink={0}>
|
||||||
<Show when={permissions().length > 0}>
|
<Show when={permissions().length > 0}>
|
||||||
<PermissionPrompt request={permissions()[0]} />
|
<PermissionPrompt
|
||||||
|
request={permissions()[0]}
|
||||||
|
directory={sync.session.get(permissions()[0].sessionID)?.directory}
|
||||||
|
/>
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={permissions().length === 0 && questions().length > 0}>
|
<Show when={permissions().length === 0 && questions().length > 0}>
|
||||||
<QuestionPrompt
|
<QuestionPrompt
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ function TextBody(props: { title: string; description?: string; icon?: string })
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PermissionPrompt(props: { request: PermissionRequest }) {
|
export function PermissionPrompt(props: { request: PermissionRequest; directory?: string }) {
|
||||||
const sdk = useSDK()
|
const sdk = useSDK()
|
||||||
const project = useProject()
|
const project = useProject()
|
||||||
const sync = useSync()
|
const sync = useSync()
|
||||||
@@ -171,6 +171,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
|||||||
void sdk.client.permission.reply({
|
void sdk.client.permission.reply({
|
||||||
reply: "always",
|
reply: "always",
|
||||||
requestID: props.request.id,
|
requestID: props.request.id,
|
||||||
|
directory: props.directory,
|
||||||
workspace: project.workspace.current(),
|
workspace: project.workspace.current(),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
@@ -182,6 +183,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
|||||||
void sdk.client.permission.reply({
|
void sdk.client.permission.reply({
|
||||||
reply: "reject",
|
reply: "reject",
|
||||||
requestID: props.request.id,
|
requestID: props.request.id,
|
||||||
|
directory: props.directory,
|
||||||
message: message || undefined,
|
message: message || undefined,
|
||||||
workspace: project.workspace.current(),
|
workspace: project.workspace.current(),
|
||||||
})
|
})
|
||||||
@@ -421,6 +423,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
|||||||
void sdk.client.permission.reply({
|
void sdk.client.permission.reply({
|
||||||
reply: "reject",
|
reply: "reject",
|
||||||
requestID: props.request.id,
|
requestID: props.request.id,
|
||||||
|
directory: props.directory,
|
||||||
workspace: project.workspace.current(),
|
workspace: project.workspace.current(),
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@@ -428,6 +431,7 @@ export function PermissionPrompt(props: { request: PermissionRequest }) {
|
|||||||
void sdk.client.permission.reply({
|
void sdk.client.permission.reply({
|
||||||
reply: "once",
|
reply: "once",
|
||||||
requestID: props.request.id,
|
requestID: props.request.id,
|
||||||
|
directory: props.directory,
|
||||||
workspace: project.workspace.current(),
|
workspace: project.workspace.current(),
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user