(
firstParentSessionId: string,
ref: string,
)
| 5095 | } |
| 5096 | |
| 5097 | private async resolveShellRunOwner( |
| 5098 | firstParentSessionId: string, |
| 5099 | ref: string, |
| 5100 | ): Promise<{ sessionId: string; result: ShellRunUpdate['result'] } | undefined> { |
| 5101 | const shellRuns = this.deps.shellRuns; |
| 5102 | if (!shellRuns) return undefined; |
| 5103 | let ownerSessionId: string | undefined = firstParentSessionId; |
| 5104 | const visited = new Set<string>(); |
| 5105 | while (ownerSessionId && !visited.has(ownerSessionId)) { |
| 5106 | visited.add(ownerSessionId); |
| 5107 | try { |
| 5108 | return { |
| 5109 | sessionId: ownerSessionId, |
| 5110 | result: await shellRuns.inspectResource(ownerSessionId, ref), |
| 5111 | }; |
| 5112 | } catch (error) { |
| 5113 | if (!isNotFoundError(error)) throw error; |
| 5114 | try { |
| 5115 | const ownerHeader = await this.deps.store.readHeader(ownerSessionId); |
| 5116 | ownerSessionId = ownerHeader.revisionParentSessionId ?? ownerHeader.parentSessionId; |
| 5117 | } catch (headerError) { |
| 5118 | if (isNotFoundError(headerError)) return undefined; |
| 5119 | throw headerError; |
| 5120 | } |
| 5121 | } |
| 5122 | } |
| 5123 | return undefined; |
| 5124 | } |
| 5125 | |
| 5126 | private async readShellRunProjectionMessages(sessionId: string): Promise<StoredMessage[] | null> { |
| 5127 | try { |
no test coverage detected