fix: repair conflict-marker artifacts from rebase auto-resolutions

rerere replayed stale resolutions during the rebase and committed nested
conflict markers in several files. Restore the branch-intended v2 shapes
and re-graft main's compatible additions (pending-card opacity comments,
theme-editor keybinding test, mobile scroll re-arm effects from #5566).

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Julius MarmingeandClaude Fable 5 committed 2026-08-15 16:51:19 +02:00
1 parent cc44d43b4b
commit e992d844b6
9 files changed
+3 -404

No files matched your search

@@ -14,13 +14,10 @@ export interface PendingApprovalCardProps {
}
export function PendingApprovalCard(props: PendingApprovalCardProps) {
<<<<<<< HEAD
// Opaque for the same reason as PendingUserInputCard: nothing blurs the feed
// behind this card, so a translucent surface bleeds messages through it.
=======
const canRespond = props.approval.responseCapability === "live";
const disabled = !canRespond || props.respondingApprovalId === props.approval.requestId;
>>>>>>> 79c36e6204 (Complete orchestration V2 frontend cutover)
return (
<View className="gap-2.5 rounded-[20px] border border-neutral-200 bg-neutral-100 p-4 dark:border-white/6 dark:bg-neutral-900">
<Text className="font-t3-bold text-2xs uppercase tracking-[1.1px] text-sky-700 dark:text-sky-300">
@@ -20,13 +20,10 @@ export interface PendingUserInputCardProps {
}
export function PendingUserInputCard(props: PendingUserInputCardProps) {
<<<<<<< HEAD
// The surface is opaque on purpose: the card floats over the thread feed
// with no blur behind it, so a translucent background renders the questions
// on top of whatever message happens to sit underneath.
=======
const canRespond = props.pendingUserInput.responseCapability === "live";
>>>>>>> 79c36e6204 (Complete orchestration V2 frontend cutover)
return (
<View className="gap-2.5 rounded-[20px] border border-neutral-200 bg-neutral-100 p-4 dark:border-white/6 dark:bg-neutral-900">
<Text className="font-t3-bold text-2xs uppercase tracking-[1.1px] text-sky-700 dark:text-sky-300">
@@ -1641,7 +1641,6 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
reportHeaderMaterialVisibility(false);
}, [props.threadId, reportHeaderMaterialVisibility]);
<<<<<<< HEAD
// A thread switch opens pinned to the end; a send explicitly returns to the
// live edge (ThreadDetailScreen scrolls the new message into place). Both
// re-arm follow regardless of where the user had scrolled before.
@@ -1656,17 +1655,6 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
}
}, [props.anchorMessageId, setEndFollow]);
const expandedWorkGroupIds = useMemo(() => {
const ids = new Set<string>();
for (const [groupId, expanded] of Object.entries(expandedWorkGroups)) {
if (expanded) {
ids.add(groupId);
}
}
return ids;
}, [expandedWorkGroups]);
=======
>>>>>>> 0c15987295 (fix: reconcile rebase with latest main)
const presentedFeed = useMemo(
() =>
deriveThreadFeedPresentation(
-348
View File
@@ -80,37 +80,6 @@ export interface ThreadFeedMessage {
readonly projectedItem: OrchestrationV2ProjectedTurnItem;
}
<<<<<<< HEAD
const MAX_VISIBLE_WORK_LOG_ENTRIES = 1;
type WorkLogToolLifecycleStatus = "inProgress" | "completed" | "failed" | "declined" | "stopped";
interface WorkLogEntry {
id: string;
createdAt: string;
turnId: TurnId | null;
label: string;
detail?: string;
command?: string;
rawCommand?: string;
changedFiles?: ReadonlyArray<string>;
tone: "thinking" | "tool" | "info" | "error";
toolTitle?: string;
itemType?: ToolLifecycleItemType;
requestKind?: PendingApproval["requestKind"];
toolLifecycleStatus?: WorkLogToolLifecycleStatus;
toolData?: unknown;
}
interface DerivedWorkLogEntry extends WorkLogEntry {
activityKind: OrchestrationThreadActivity["kind"];
collapseKey?: string;
/** Grouping key for subagent lifecycle rows (one row per agent). */
taskId?: string;
}
=======
>>>>>>> 79c36e6204 (Complete orchestration V2 frontend cutover)
type RawThreadFeedEntry =
| {
readonly type: "message";
@@ -175,323 +144,6 @@ function normalizeDraftAnswer(value: string | undefined): string | null {
function resolvePendingUserInputAnswer(
draft: PendingUserInputDraftAnswer | undefined,
): string | null {
<<<<<<< HEAD
const customAnswer = normalizeDraftAnswer(draft?.customAnswer);
if (customAnswer) {
return customAnswer;
}
return normalizeDraftAnswer(draft?.selectedOptionLabel);
}
/** Codex children settle via task.updated (idle/failed/interrupted), never
* task.completed — these rows are mobile's only terminal signal for them. */
const MOBILE_TERMINAL_UPDATE_STATUSES: ReadonlySet<string> = new Set([
"idle",
"completed",
"failed",
"cancelled",
"interrupted",
]);
function isTerminalBypassUpdate(activity: OrchestrationThreadActivity): boolean {
if (activity.kind !== "task.updated") {
return false;
}
const payload =
activity.payload && typeof activity.payload === "object"
? (activity.payload as Record<string, unknown>)
: null;
return (
payload?.timelineBypass === true &&
typeof payload.status === "string" &&
MOBILE_TERMINAL_UPDATE_STATUSES.has(payload.status)
);
}
/**
* Quiet-timeline guarantee (mirrors web's session-logic): agent-internal
* activity lives in the Agents sheet, not the work log. Terminal rows are
* kept — with no Agents surface on mobile they are the terminal signal
* (a surface that hides rows must keep its own terminal signal). That means
* task.completed (Claude) AND terminal bypassed task.updated (Codex, whose
* children never emit task.completed — review finding).
*/
function isAgentInternalActivity(activity: OrchestrationThreadActivity): boolean {
const payload =
activity.payload && typeof activity.payload === "object"
? (activity.payload as Record<string, unknown>)
: null;
if (!payload) {
return false;
}
const isTerminalTaskRow = activity.kind === "task.completed" || isTerminalBypassUpdate(activity);
if (payload.timelineBypass === true && !isTerminalTaskRow) {
return true;
}
// agentId marks ownership, not "hide me": a NESTED AGENT's terminal row is
// the only signal mobile gets (no Agents sheet), so it stays. Only an
// agent's own background work (stamped "background") is internal — same
// rule as web (review finding: hiding on agentId alone dropped nested
// completions with no replacement UI).
const ownedByAgent = typeof payload.agentId === "string" && payload.agentId.trim().length > 0;
if (!ownedByAgent) {
return false;
}
return !(isTerminalTaskRow && payload.agentKind === "agent");
}
function deriveWorkLogEntries(
activities: ReadonlyArray<OrchestrationThreadActivity>,
): DerivedWorkLogEntry[] {
const ordered = Arr.sort(activities, activityOrder);
const entries: DerivedWorkLogEntry[] = [];
for (const activity of ordered) {
if (activity.kind === "tool.started") continue;
if (activity.kind === "task.started") continue;
// Terminal bypassed updates pass: Codex children's only terminal signal.
if (activity.kind === "task.updated" && !isTerminalBypassUpdate(activity)) continue;
if (activity.kind === "tool.progress") continue;
if (activity.kind === "context-window.updated") continue;
if (activity.summary === "Checkpoint captured") continue;
if (isPlanBoundaryToolActivity(activity)) continue;
if (isAgentInternalActivity(activity)) continue;
entries.push(toDerivedWorkLogEntry(activity));
}
return collapseDerivedWorkLogEntries(entries);
}
function isPlanBoundaryToolActivity(activity: OrchestrationThreadActivity): boolean {
if (activity.kind !== "tool.updated" && activity.kind !== "tool.completed") {
return false;
}
const payload =
activity.payload && typeof activity.payload === "object"
? (activity.payload as Record<string, unknown>)
: null;
return typeof payload?.detail === "string" && payload.detail.startsWith("ExitPlanMode:");
}
function toDerivedWorkLogEntry(activity: OrchestrationThreadActivity): DerivedWorkLogEntry {
const payload =
activity.payload && typeof activity.payload === "object"
? (activity.payload as Record<string, unknown>)
: null;
const commandPreview = extractToolCommand(payload);
const changedFiles = extractChangedFiles(payload);
const title = extractToolTitle(payload);
// task.updated included: terminal bypassed updates (Codex children's only
// terminal signal) must carry task identity so they collapse per child
// instead of stacking anonymous "Task idle" rows.
const isTaskActivity =
activity.kind === "task.progress" ||
activity.kind === "task.completed" ||
activity.kind === "task.updated";
const taskSummary =
isTaskActivity && typeof payload?.summary === "string" && payload.summary.length > 0
? payload.summary
: null;
const taskDetailAsLabel =
isTaskActivity &&
!taskSummary &&
typeof payload?.detail === "string" &&
payload.detail.length > 0
? payload.detail
: null;
const taskLabel = taskSummary || taskDetailAsLabel;
const taskId =
isTaskActivity && typeof payload?.taskId === "string" && payload.taskId.length > 0
? payload.taskId
: undefined;
const entry: DerivedWorkLogEntry = {
id: activity.id,
createdAt: activity.createdAt,
turnId: activity.turnId,
...(taskId ? { taskId } : {}),
label: taskLabel || activity.summary,
tone:
activity.kind === "task.progress"
? "thinking"
: activity.tone === "approval"
? "info"
: activity.tone,
activityKind: activity.kind,
};
const itemType = extractWorkLogItemType(payload);
const requestKind = extractWorkLogRequestKind(payload);
if (
!taskDetailAsLabel &&
payload &&
typeof payload.detail === "string" &&
payload.detail.length > 0
) {
const detail = stripTrailingExitCode(payload.detail).output;
if (detail) {
entry.detail = detail;
}
}
if (commandPreview.command) {
entry.command = commandPreview.command;
}
if (commandPreview.rawCommand) {
entry.rawCommand = commandPreview.rawCommand;
}
if (changedFiles.length > 0) {
entry.changedFiles = changedFiles;
}
if (title) {
entry.toolTitle = title;
}
if (itemType === "mcp_tool_call") {
const data = asRecord(payload?.data);
if (data?.item !== undefined) {
entry.toolData = data.item;
}
}
if (itemType) {
entry.itemType = itemType;
}
if (requestKind) {
entry.requestKind = requestKind;
}
let toolLifecycleStatus = extractWorkLogToolLifecycleStatus(payload);
if (!toolLifecycleStatus && activity.kind === "tool.completed") {
toolLifecycleStatus = "completed";
}
if (toolLifecycleStatus) {
entry.toolLifecycleStatus = toolLifecycleStatus;
}
const collapseKey = deriveToolLifecycleCollapseKey(entry);
if (collapseKey) {
entry.collapseKey = collapseKey;
}
return entry;
}
function collapseDerivedWorkLogEntries(
entries: ReadonlyArray<DerivedWorkLogEntry>,
): DerivedWorkLogEntry[] {
const collapsed: DerivedWorkLogEntry[] = [];
// Subagent rows collapse by identity, not adjacency (quiet-timeline
// guarantee; mirrors web's session-logic).
const taskRowIndex = new Map<string, number>();
for (const entry of entries) {
const isTaskRow =
entry.taskId !== undefined &&
(entry.activityKind === "task.progress" ||
entry.activityKind === "task.completed" ||
entry.activityKind === "task.updated");
if (isTaskRow && entry.taskId !== undefined) {
const existingIndex = taskRowIndex.get(entry.taskId);
if (existingIndex !== undefined) {
collapsed[existingIndex] = mergeDerivedWorkLogEntries(collapsed[existingIndex]!, entry);
continue;
}
taskRowIndex.set(entry.taskId, collapsed.length);
collapsed.push(entry);
continue;
}
const previous = collapsed.at(-1);
if (previous && shouldCollapseToolLifecycleEntries(previous, entry)) {
collapsed[collapsed.length - 1] = mergeDerivedWorkLogEntries(previous, entry);
continue;
}
collapsed.push(entry);
}
return collapsed;
}
function shouldCollapseToolLifecycleEntries(
previous: DerivedWorkLogEntry,
next: DerivedWorkLogEntry,
): boolean {
if (previous.activityKind !== "tool.updated" && previous.activityKind !== "tool.completed") {
return false;
}
if (next.activityKind !== "tool.updated" && next.activityKind !== "tool.completed") {
return false;
}
if (previous.activityKind === "tool.completed") {
return false;
}
return previous.collapseKey !== undefined && previous.collapseKey === next.collapseKey;
}
function mergeDerivedWorkLogEntries(
previous: DerivedWorkLogEntry,
next: DerivedWorkLogEntry,
): DerivedWorkLogEntry {
const changedFiles = mergeChangedFiles(previous.changedFiles, next.changedFiles);
const detail = next.detail ?? previous.detail;
const command = next.command ?? previous.command;
const rawCommand = next.rawCommand ?? previous.rawCommand;
const toolTitle = next.toolTitle ?? previous.toolTitle;
const itemType = next.itemType ?? previous.itemType;
const requestKind = next.requestKind ?? previous.requestKind;
const collapseKey = next.collapseKey ?? previous.collapseKey;
const toolLifecycleStatus = next.toolLifecycleStatus ?? previous.toolLifecycleStatus;
const toolData = next.toolData ?? previous.toolData;
return {
...previous,
...next,
...(detail ? { detail } : {}),
...(command ? { command } : {}),
...(rawCommand ? { rawCommand } : {}),
...(changedFiles.length > 0 ? { changedFiles } : {}),
...(toolTitle ? { toolTitle } : {}),
...(itemType ? { itemType } : {}),
...(requestKind ? { requestKind } : {}),
...(collapseKey ? { collapseKey } : {}),
...(toolLifecycleStatus ? { toolLifecycleStatus } : {}),
...(toolData !== undefined ? { toolData } : {}),
};
}
function mergeChangedFiles(
previous: ReadonlyArray<string> | undefined,
next: ReadonlyArray<string> | undefined,
): string[] {
const merged = [...(previous ?? []), ...(next ?? [])];
if (merged.length === 0) {
return [];
}
return [...new Set(merged)];
}
function deriveToolLifecycleCollapseKey(entry: DerivedWorkLogEntry): string | undefined {
if (entry.activityKind !== "tool.updated" && entry.activityKind !== "tool.completed") {
return undefined;
}
const normalizedLabel = normalizeCompactToolLabel(entry.toolTitle ?? entry.label);
const detail = entry.detail?.trim() ?? "";
const itemType = entry.itemType ?? "";
if (normalizedLabel.length === 0 && detail.length === 0 && itemType.length === 0) {
return undefined;
}
return [itemType, normalizedLabel, detail].join("\u001f");
}
function normalizeCompactToolLabel(value: string): string {
return value.replace(/\s+(?:complete|completed)\s*$/i, "").trim();
}
function workLogEntryIsToolLike(entry: WorkLogEntry): boolean {
if (entry.tone === "tool" || entry.tone === "thinking" || entry.tone === "error") {
return true;
}
if (entry.command !== undefined && entry.command.trim().length > 0) {
return true;
}
if (entry.requestKind !== undefined) {
return true;
}
return entry.itemType !== undefined && isToolLifecycleItemType(entry.itemType);
}
function toolDetailTextLooksLikeFailure(text: string): boolean {
const normalized = text.toLowerCase();
=======
>>>>>>> 79c36e6204 (Complete orchestration V2 frontend cutover)
return (
<<<<<<< HEAD
normalized.includes("file not found") ||
-11
View File
@@ -21,16 +21,6 @@ type WsRpcMethod = RpcGroup.Rpcs<typeof WsRpcGroup>["_tag"];
* runtime failure.
*/
export const RPC_REQUIRED_SCOPES = {
<<<<<<< HEAD
[ORCHESTRATION_WS_METHODS.dispatchCommand]: AuthOrchestrationOperateScope,
[ORCHESTRATION_WS_METHODS.getWorkflowScript]: AuthOrchestrationReadScope,
[ORCHESTRATION_WS_METHODS.getTurnDiff]: AuthOrchestrationReadScope,
[ORCHESTRATION_WS_METHODS.getFullThreadDiff]: AuthOrchestrationReadScope,
[ORCHESTRATION_WS_METHODS.searchThreads]: AuthOrchestrationReadScope,
[ORCHESTRATION_WS_METHODS.subscribeShell]: AuthOrchestrationReadScope,
[ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot]: AuthOrchestrationReadScope,
[ORCHESTRATION_WS_METHODS.subscribeThread]: AuthOrchestrationReadScope,
=======
[ORCHESTRATION_V2_WS_METHODS.dispatchCommand]: AuthOrchestrationOperateScope,
[ORCHESTRATION_V2_WS_METHODS.getTurnDiff]: AuthOrchestrationReadScope,
[ORCHESTRATION_V2_WS_METHODS.getFullThreadDiff]: AuthOrchestrationReadScope,
@@ -42,7 +32,6 @@ export const RPC_REQUIRED_SCOPES = {
[ORCHESTRATION_V2_WS_METHODS.subscribeShell]: AuthOrchestrationReadScope,
[ORCHESTRATION_V2_WS_METHODS.subscribeThread]: AuthOrchestrationReadScope,
[WS_METHODS.projectsMutate]: AuthOrchestrationOperateScope,
>>>>>>> 0c15987295 (fix: reconcile rebase with latest main)
[WS_METHODS.serverProbe]: AuthOrchestrationReadScope,
[WS_METHODS.serverGetConfig]: AuthOrchestrationReadScope,
[WS_METHODS.serverRefreshProviders]: AuthOrchestrationOperateScope,
@@ -79,7 +79,6 @@ export const ComposerPrimaryActions = memo(function ComposerPrimaryActions({
const stageBackdropVariant = useSidebarStageBackdropVariant(
environmentIdentificationMode === "artwork",
);
>>>>>>> ab978b6ee3 (fix: reconcile rebase with latest main)
const renderStopGenerationButton = (insidePendingAction: boolean) => (
<button
@@ -1,11 +1,7 @@
import { EnvironmentId } from "@t3tools/contracts";
import { describe, expect, it } from "vite-plus/test";
<<<<<<< HEAD:apps/web/src/components/chat/ChatHeader.test.ts
import { resolveRenameCommit, shouldShowOpenInPicker } from "./ChatHeader";
=======
import { shouldShowOpenInPicker } from "./OpenInPicker.logic";
>>>>>>> 786f5c5767 (Split open-in editor controls into panel and toolbar variants):apps/web/src/components/chat/OpenInPicker.test.ts
describe("shouldShowOpenInPicker", () => {
const primaryEnvironmentId = EnvironmentId.make("environment-primary");
-19
View File
@@ -40,22 +40,7 @@ const VCS_REFS_STORE_NAME = "vcs-refs";
const CATALOG_KEY = "document";
const StoredShellSnapshot = StoredOrchestrationShellSnapshot;
const StoredShellSnapshotJson = Schema.fromJsonString(StoredShellSnapshot);
<<<<<<< HEAD
// v2 stores the snapshot sequence alongside the thread so a warm cache can
// resume via `afterSequence` instead of re-downloading the full thread body.
// v3 adds windowed (paginated) snapshots carrying `page` metadata. The bump
// exists for rollback safety: a pre-pagination client would decode a windowed
// v2 record, silently drop the unknown `page` field, and treat the partial
// thread as complete forever. Older entries fail to decode → cold cache.
const StoredThreadSnapshot = Schema.Struct({
schemaVersion: Schema.Literal(3),
environmentId: EnvironmentId,
threadId: ThreadId,
snapshot: OrchestrationThreadDetailSnapshot,
});
=======
const StoredThreadSnapshot = StoredOrchestrationThreadSnapshot;
>>>>>>> 79c36e6204 (Complete orchestration V2 frontend cutover)
const StoredThreadSnapshotJson = Schema.fromJsonString(StoredThreadSnapshot);
const StoredServerConfig = Schema.Struct({
schemaVersion: Schema.Literal(1),
@@ -561,11 +546,7 @@ export const connectionStorageLayer = Layer.effectContext(
saveThread: (environmentId, snapshot) =>
Effect.gen(function* () {
const encoded = yield* encodeStoredThreadSnapshot({
<<<<<<< HEAD
schemaVersion: 3,
=======
schemaVersion: ORCHESTRATION_CACHE_SCHEMA_VERSION,
>>>>>>> 79c36e6204 (Complete orchestration V2 frontend cutover)
environmentId,
threadId: snapshot.projection.thread.id,
snapshot,
+3 -3
View File
@@ -556,7 +556,6 @@ describe("chat/editor shortcuts", () => {
);
});
<<<<<<< HEAD
it("matches themeEditor.toggle on macOS and Windows", () => {
assert.strictEqual(
resolveShortcutCommand(
@@ -573,7 +572,9 @@ describe("chat/editor shortcuts", () => {
{ platform: "Win32" },
),
"themeEditor.toggle",
=======
);
});
it("matches filePicker.toggle shortcut outside terminal focus", () => {
assert.strictEqual(
resolveShortcutCommand(event({ key: "p", metaKey: true }), DEFAULT_BINDINGS, {
@@ -605,7 +606,6 @@ describe("chat/editor shortcuts", () => {
context: { terminalFocus: true },
}),
"projectSearch.toggle",
>>>>>>> 0c15987295 (fix: reconcile rebase with latest main)
);
});