fix: bootstrap embedded chat prompting state and review read-only handling

Pass initial subagent prompting settings into embedded chat URLs and views
Prevent inactive embedded chats from stealing focus on load
Treat review sessions as independent conversations when resolving prompt read-only state
This commit is contained in:
Bohdan Triapitsyn
2026-08-13 22:01:11 +03:00
parent e99f6560be
commit a9edc71e06
9 changed files with 80 additions and 17 deletions
@@ -128,6 +128,17 @@ describe('embedded session chat URL', () => {
expect(new URL(second).searchParams.get('themeVariant')).toBe('dark');
});
test('bootstraps subagent prompting before the embedded chat first renders', () => {
const src = buildEmbeddedSessionChatURL('ses_1', '/repo', false, {
mode: 'system',
lightThemeId: 'light-a',
darkThemeId: 'dark-a',
currentTheme: makeTheme('dark-a', 'dark'),
}, { allowPromptingSubagentSessions: true });
expect(new URL(src).searchParams.get('allowPromptingSubagentSessions')).toBe('1');
});
test('rebuilds cached src when readOnly changes for an existing tab', () => {
const cache = new Map<string, EmbeddedSessionChatURLCacheEntry>();
const theme = {