Merge latest main and preserve teacher upgrade safeguards
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
鲨鱼辣椒
2026-09-28 18:42:04 +08:00
28 changed files with 1435 additions and 93 deletions

View File

@@ -479,11 +479,13 @@ export class CodingTeacherService {
const previous = topic.requests.at(-1);
const reuse = previous && !previous.origin && previous.projectId === scope.projectId
&& previous.sourceConversationId === input.sourceConversationId
&& previous.presentation === 'reply-v1'
&& previous.teacherVersion === selected.version && previous.runtimeThreadId;
newConversationSegment = !reuse;
// Yuxi binds both project and Pi source to a thread. Preserve its native
// summary middleware within a segment; explicitly carry bounded public
// history only when a new scope/release starts another segment.
// history only when a new scope, release, or reply protocol starts another
// segment. Older checkpoints may still contain retired component instructions.
topic.conversation!.runtimeThreadId = reuse || randomUUID();
topic.conversation!.segmentTurns = reuse ? topic.conversation!.segmentTurns + 1 : 1;
}