feat: open subagent sessions read-only in context panel

Adds read-only embedded chat mode without hiding permission prompts
Opens subagent sessions in the context panel instead of replacing the main chat
Fixes context panel message loading for embedded sessions
This commit is contained in:
Bohdan Triapitsyn
2026-05-15 22:16:04 +03:00
parent 040b6a9dc6
commit 9828ddb4b1
15 changed files with 117 additions and 38 deletions
@@ -486,7 +486,7 @@ const desktopAnnotationToFile = async (
}
};
const buildEmbeddedSessionChatURL = (sessionID: string, directory: string | null): string => {
const buildEmbeddedSessionChatURL = (sessionID: string, directory: string | null, readOnly: boolean): string => {
if (typeof window === 'undefined') {
return '';
}
@@ -494,6 +494,11 @@ const buildEmbeddedSessionChatURL = (sessionID: string, directory: string | null
const url = new URL(window.location.pathname, window.location.origin);
url.searchParams.set('ocPanel', 'session-chat');
url.searchParams.set('sessionId', sessionID);
if (readOnly) {
url.searchParams.set('readOnly', '1');
} else {
url.searchParams.delete('readOnly');
}
if (directory && directory.trim().length > 0) {
url.searchParams.set('directory', directory);
} else {
@@ -1937,7 +1942,7 @@ export const ContextPanel: React.FC = () => {
return null;
}
const src = buildEmbeddedSessionChatURL(sessionID, directoryKey || null);
const src = buildEmbeddedSessionChatURL(sessionID, directoryKey || null, tab.readOnly);
if (!src) {
return null;
}