Repository navigation
fix(terminal): answer queries in output a paused paired view discards #33783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
09124e9
dba3a36
237df8f
aecdc27
a4be82f
0b0888f
56e1ae4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ import { | |
| normalizeTerminalTitle | ||
| } from '../../../../shared/agent-detection' | ||
| import { shouldModelAnswerHiddenPtyQueries } from '../../terminal-model-query-authority' | ||
| import { extractHiddenStartupRendererQueryData } from '../../../../shared/terminal-reply-query-extraction' | ||
|
|
||
| export abstract class OrcaRuntimeWithMaybeHydrateHeadlessFromRenderer extends OrcaRuntimeWithSerializeMainTerminalBuffer { | ||
| protected abstract getOrCreateHeadlessTerminal(ptyId: string): RuntimeHeadlessTerminal | ||
|
|
@@ -148,6 +149,23 @@ export abstract class OrcaRuntimeWithMaybeHydrateHeadlessFromRenderer extends Or | |
| }) | ||
| } | ||
|
|
||
| /** Answer stateless queries in output a remote view yielded at ingestion but will never receive. */ | ||
| answerYieldedTerminalQueries(ptyId: string, data: string): void { | ||
| const state = this.headlessTerminals.get(ptyId) | ||
| const { statelessQueryData } = extractHiddenStartupRendererQueryData(data, '') | ||
| if (!state || !statelessQueryData || !this.shouldAnswerQueriesForLiveChunk(ptyId)) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔎 Supported by static analysis
Base salvage on the discarded chunk’s recipients. If view A parks a DA1 query and view B subscribes afterward, B makes Subscription replay only replays queries captured in B’s own pending buffer. It cannot replay a query received before B subscribed. Track query ownership or chunk recipients at ingestion, while preserving suppression when another view actually received the bytes. |
||
| return | ||
| } | ||
| state.writeChain = state.writeChain | ||
| .then(async () => { | ||
| // Why: injecting mid-escape would abort the live sequence and print its tail as text. | ||
| if (state.emulator.partialEscapeTailAnsi === '') { | ||
| await state.emulator.write(statelessQueryData, { forwardQueryReplies: true }) | ||
|
Comment on lines
+169
to
+173
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check query age when the queued write executes. If hydration or earlier terminal writes hold |
||
| } | ||
| }) | ||
| .catch(() => {}) | ||
| } | ||
|
|
||
| protected trackHeadlessTerminalData( | ||
| ptyId: string, | ||
| data: string, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.