GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): recover side-chat fork history from its parent by ScottN-PV · Pull Request #28849 · pingdotgg/t3code

fix(server): recover side-chat fork history from its parent #28849

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.

Sign up for GitHub

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

Closed
ScottN-PV wants to merge 1 commit into pingdotgg:main from ScottN-PV:fix/28809-side-chat-recovery-thread

Uh oh!

There was an error while loading. Please reload this page.

Closed

fix(server): recover side-chat fork history from its parent #28849

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
633a0b6
fix(server): recover side-chat fork history from its parent
ScottN-PV Nov 1, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
fix(server): recover side-chat fork history from its parent
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@ScottN-PV
ScottN-PV committed Nov 1, 2026
commit 633a0b6ed78e76a5715302c3421c6fdf66df26e1

There are no files selected for viewing

8 changes: 7 additions & 1 deletion 8 apps/server/src/orchestration-v2/ContextHandoffService.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export interface ContextHandoffServiceV2Shape {
}) => Effect.Effect<OrchestrationV2ContextHandoff, ContextHandoffServiceV2Error>;
readonly prepareProviderHandoff: (input: {
readonly threadId: ThreadId;
/** Source history may live outside the thread that owns this handoff. */
readonly historyThreadId?: ThreadId | undefined;
readonly targetRunId: RunId;
readonly transferId: OrchestrationV2ContextHandoff["transferId"];
readonly fromProviderThreadIds: ReadonlyArray<ProviderThreadId>;
Expand Down Expand Up @@ -485,6 +487,7 @@ const makeContextHandoffService = Effect.fn("orchestrationV2.ContextHandoffServi
"orchestrationV2.contextHandoff.prepareProviderHandoff",
)(function* (input: {
readonly threadId: ThreadId;
readonly historyThreadId?: ThreadId | undefined;
readonly targetRunId: RunId;
readonly transferId: OrchestrationV2ContextHandoff["transferId"];
readonly fromProviderThreadIds: ReadonlyArray<ProviderThreadId>;
Expand Down Expand Up @@ -519,7 +522,10 @@ const makeContextHandoffService = Effect.fn("orchestrationV2.ContextHandoffServi
),
);
const runStatuses = new Map(input.runs?.map((run) => [run.id, run.status]));
const coverage = handoffCoverage(input);
const coverage = handoffCoverage({
...input,
threadId: input.historyThreadId ?? input.threadId,
});
const selected = selectHistory({
messages: input.items.flatMap((item) => {
const message = historicalMessage(item);
Expand Down
1 change: 1 addition & 0 deletions 1 apps/server/src/orchestration-v2/Orchestrator.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6673,6 +6673,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
: yield* contextHandoffService
.prepareProviderHandoff({
threadId: command.threadId,
historyThreadId: sideChatFork ? sourceProjection.thread.id : undefined,
targetRunId: runId,
transferId: pendingForkTransfer.id,
fromProviderThreadIds:
Expand Down
52 changes: 52 additions & 0 deletions 52 apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,58 @@ it.effect("resolves an explicit checkpoint fork to its source run", () =>
}).pipe(Effect.provide(forkCases[0]!.layer)),
);

it.effect.each([true, false])(
"portable fork recovery uses the readable history thread (sideChat=%s)",
(sideChat) =>
Effect.gen(function* () {
const orchestrator = yield* Orchestrator.OrchestratorV2;
const parentId = ThreadId.make("recovery-parent");
const childId = ThreadId.make("recovery-child");
yield* createParent(parentId);
yield* writeParentRun({
threadId: parentId,
runId: RunId.make("recovery-stable-run"),
ordinal: 1,
status: "completed",
text: "Earlier parent history",
stable: true,
});
yield* writeParentRun({
threadId: parentId,
runId: RunId.make("recovery-busy-run"),
ordinal: 2,
status: "running",
text: "Parent work in progress",
});
yield* orchestrator.dispatch({
type: "thread.fork",
commandId: CommandId.make("recovery-fork"),
sourceThreadId: parentId,
targetThreadId: childId,
sourcePoint: { type: "latest_stable" },
sideChat,
createdBy: "user",
creationSource: "web",
});
yield* askSideChat(childId, "recovery-first-message");

const child = yield* orchestrator.getThreadProjection(childId);
const handoff = child.contextHandoffs.find((item) => item.strategy === "full_thread_summary");
assert.isDefined(handoff);
assert.equal(child.contextTransfers[0]?.resolution?.strategy, "portable_context");
assert.equal(handoff!.threadId, childId);
assert.equal(handoff!.targetRunId, child.runs[0]?.id);
const historyThreadId = sideChat ? parentId : childId;
assert.include(
handoff!.history?.coverage ?? "",
`t3_thread_read({threadId:"${historyThreadId}"`,
);
if (sideChat) {
assert.notInclude(handoff!.history?.coverage ?? "", `threadId:"${childId}"`);
}
}).pipe(Effect.provide(forkCases[0]!.layer)),
);

it.effect("a side chat of an idle parent still starts with the framing note", () =>
Effect.gen(function* () {
const orchestrator = yield* Orchestrator.OrchestratorV2;
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.