GeezerVison is showing github.com — fix: reconcile main's round-19 features after the rebase · pingdotgg/t3code@8431bf4
File treeExpand file treeCollapse file tree Open diff view settings orchestration-v2/Adapters
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/ThreadFeed.tsx +38-7Lines changed: 38 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -90,6 +90,7 @@ import Animated, { | 90 | 90 | import { useUniwindTheme } from "../../lib/useUniwindTheme"; | 91 | 91 | import { IOS_NAV_BAR_HEIGHT } from "../../lib/layoutMetrics"; | 92 | 92 | import { useFontFamily } from "../../lib/useFontFamily"; | | 93 | +import { renderAssistantCitationsAsText } from "@t3tools/shared/assistantCitations"; | 93 | 94 | import { scopedThreadKey } from "../../lib/scopedEntities"; | 94 | 95 | import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic"; | 95 | 96 | import { tryOpenExternalUrl } from "../../lib/openExternalUrl"; | @@ -128,7 +129,11 @@ import { | 128 | 129 | } from "../review/nativeReviewDiffAdapter"; | 129 | 130 | import { buildReviewParsedDiff } from "../review/reviewModel"; | 130 | 131 | import { cn } from "../../lib/cn"; | 131 | | -import { deriveCenteredContentHorizontalPadding, type LayoutVariant } from "../../lib/layout"; | | 132 | +import { | | 133 | + deriveCenteredContentHorizontalPadding, | | 134 | + deriveThreadWorkLogSizing, | | 135 | + type LayoutVariant, | | 136 | +} from "../../lib/layout"; | 132 | 137 | import { uuidv4 } from "../../lib/uuid"; | 133 | 138 | import { | 134 | 139 | resolveMarkdownFontSizes, | @@ -152,6 +157,7 @@ import type { ThreadContentPresentation } from "./threadContentPresentation"; | 152 | 157 | import { | 153 | 158 | resolveThreadFeedLiveFollow, | 154 | 159 | type ThreadFeedLiveFollowEvent, | | 160 | + type ThreadWorkGroupScrollPosition, | 155 | 161 | } from "./thread-feed-live-follow"; | 156 | 162 | import { | 157 | 163 | ThreadDisclosureChevron, | @@ -176,7 +182,12 @@ import { appAtomRegistry } from "../../state/atom-registry"; | 176 | 182 | import { environmentThreadShells, threadEnvironment } from "../../state/threads"; | 177 | 183 | import { useAtomCommand } from "../../state/use-atom-command"; | 178 | 184 | import { useV2ItemSupport } from "../../state/v2-item-support"; | 179 | | -import { resolveWorkspaceRelativeFilePath } from "../files/filePath"; | | 185 | +import { | | 186 | + basename, | | 187 | + fileRoutePathSegments, | | 188 | + isAbsolutePath, | | 189 | + resolveWorkspaceRelativeFilePath, | | 190 | +} from "../files/filePath"; | 180 | 191 | import { waitForThreadShellReady } from "./threadForkNavigation"; | 181 | 192 | import { resolveUserMessageIntentBadge } from "./userMessageIntentBadge"; | 182 | 193 |
| @@ -1829,15 +1840,12 @@ function renderFeedEntry( | 1829 | 1840 | activities={entry.activities} | 1830 | 1841 | anchorKey={entry.id} | 1831 | 1842 | copiedRowId={props.copiedRowId} | 1832 | | - currentThreadId={props.threadId} | 1833 | | - environmentId={props.environmentId} | 1834 | 1843 | expandedRows={props.expandedWorkRows} | 1835 | 1844 | rowSizing={props.workRowSizing} | 1836 | 1845 | scrollPositions={props.workGroupScrollPositions} | 1837 | 1846 | iconSubtleColor={iconSubtleColor} | 1838 | 1847 | onCopyRow={props.onCopyWorkRow} | 1839 | | - onToggleRow={(rowId) => props.onToggleWorkRow(rowId, entry.id)} | 1840 | | - workspaceRoot={props.workspaceRoot} | | 1848 | + onToggleRow={props.onToggleWorkRow} | 1841 | 1849 | renderImage={props.renderViewedImage} | 1842 | 1850 | /> | 1843 | 1851 | ); | @@ -2156,7 +2164,22 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { | 2156 | 2164 | const previousLatestTurnRef = useRef(props.latestRun); | 2157 | 2165 | const userScrollSettleTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null); | 2158 | 2166 | const headerMaterialVisibleRef = useRef(false); | 2159 | | - const { width: windowWidth } = useWindowDimensions(); | | 2167 | + const { width: windowWidth, fontScale } = useWindowDimensions(); | | 2168 | + const { appearance } = useAppearancePreferences(); | | 2169 | + const workRowSizing = useMemo( | | 2170 | + () => deriveThreadWorkLogSizing({ baseFontSize: appearance.baseFontSize, fontScale }), | | 2171 | + [appearance.baseFontSize, fontScale], | | 2172 | + ); | | 2173 | + const previousTextSize = useRef(workRowSizing.textSizeKey); | | 2174 | + useLayoutEffect(() => { | | 2175 | + if (previousTextSize.current === workRowSizing.textSizeKey) { | | 2176 | + return; | | 2177 | + } | | 2178 | + previousTextSize.current = workRowSizing.textSizeKey; | | 2179 | + // Text-size changes invalidate the outer list's fixed-height cache too. | | 2180 | + // This never runs for scrolling, streamed output, or disclosure toggles. | | 2181 | + props.listRef.current?.clearCaches({ mode: "sizes" }); | | 2182 | + }, [workRowSizing.textSizeKey, props.listRef]); | 2160 | 2183 | const [viewportWidth, setViewportWidth] = useState(() => | 2161 | 2184 | props.layoutVariant === "split" ? 0 : windowWidth, | 2162 | 2185 | ); | @@ -2527,6 +2550,12 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { | 2527 | 2550 | // ThreadId, and keying resets (or the list mount) on the bare id would | 2528 | 2551 | // carry stale scroll/follow state across an environment switch. | 2529 | 2552 | const feedThreadKey = scopedThreadKey(props.environmentId, props.threadId); | | 2553 | + // Virtualized groups can unmount without losing the reader's place. This cache | | 2554 | + // belongs to this thread view only and never causes per-scroll React updates. | | 2555 | + const workGroupScrollPositions = useMemo( | | 2556 | + () => new Map<string, ThreadWorkGroupScrollPosition>(), | | 2557 | + [feedThreadKey], | | 2558 | + ); | 2530 | 2559 | // A thread switch opens pinned to the end; a send explicitly returns to the | 2531 | 2560 | // live edge (ThreadDetailScreen scrolls the new message into place). Both | 2532 | 2561 | // re-arm follow regardless of where the user had scrolled before. | @@ -2840,6 +2869,8 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { | 2840 | 2869 | threadId: props.threadId, | 2841 | 2870 | copiedRowId, | 2842 | 2871 | expandedWorkRows, | | 2872 | + workRowSizing, | | 2873 | + workGroupScrollPositions, | 2843 | 2874 | terminalAssistantMessageIds, | 2844 | 2875 | unsettledTurnId, | 2845 | 2876 | onCopyWorkRow, | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/threadPresentation.ts -11Lines changed: 0 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,11 +4,6 @@ import { | 4 | 4 | type EnvironmentThreadShell, | 5 | 5 | } from "@t3tools/client-runtime/state/shell"; | 6 | 6 |
| 7 | | -export function threadSortValue(thread: EnvironmentThreadShell): number { | 8 | | - const candidate = Date.parse(thread.updatedAt ?? thread.createdAt); | 9 | | - return Number.isNaN(candidate) ? 0 : candidate; | 10 | | -} | 11 | | - | 12 | 7 | export type ThreadStatusKind = | 13 | 8 | | "pending-approval" | 14 | 9 | | "awaiting-input" | @@ -27,12 +22,6 @@ export interface ThreadStatusPresentation extends StatusTone { | 27 | 22 | readonly pulse: boolean; | 28 | 23 | } | 29 | 24 |
| 30 | | -/** Neutral icon colors for threads with no actionable status. */ | 31 | | -export const THREAD_STATUS_NEUTRAL_ICON = { | 32 | | - iconColor: "#8e8e93", | 33 | | - iconBackground: "rgba(142,142,147,0.22)", | 34 | | -} as const; | 35 | | - | 36 | 25 | function isLatestRunSettled(thread: EnvironmentThreadShell): boolean { | 37 | 26 | if (!thread.latestRun?.startedAt) return false; | 38 | 27 | if (!thread.latestRun.completedAt) return false; | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/lib/projectThreadStartTurn.test.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,7 +26,7 @@ describe("project thread title", () => { | 26 | 26 | }, | 27 | 27 | { | 28 | 28 | comment: 'Why "shared"?', | 29 | | - title: 'Keep `cache[key]` & <parser> shared. Retry! Comment: Why "shared"?', | | 29 | + title: "Keep `cache[key]` & <parser> shared. Retry! Commen...", | 30 | 30 | }, | 31 | 31 | ])("uses readable titles and intact links with comment $comment", ({ comment, title }) => { | 32 | 32 | const quoteText = "Keep `cache[key]` & <parser> shared.\n Retry!"; | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/lib/projectThreadStartTurn.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | type RuntimeMode, | 10 | 10 | } from "@t3tools/contracts"; | 11 | 11 | import { deriveThreadTitleSeed } from "@t3tools/client-runtime/operations"; | | 12 | +import { assistantCitationsToPlainText } from "@t3tools/shared/assistantCitations"; | 12 | 13 |
| 13 | 14 | import type { UploadedMobileAttachment } from "./attachmentUpload"; | 14 | 15 |
| @@ -85,7 +86,7 @@ export function buildProjectThreadStartTurnInput(spec: ProjectThreadStartTurnSpe | 85 | 86 | } | 86 | 87 |
| 87 | 88 | export function deriveThreadTitleFromPrompt(value: string): string { | 88 | | - const trimmed = value.trim(); | | 89 | + const trimmed = assistantCitationsToPlainText(value).trim(); | 89 | 90 | if (trimmed.length === 0) { | 90 | 91 | return "New thread"; | 91 | 92 | } | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/lib/threadActivity.test.ts +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -679,9 +679,7 @@ describe("buildThreadFeed", () => { | 679 | 679 | ); | 680 | 680 | expect(expanded.map((entry) => entry.id)).toEqual([ | 681 | 681 | "work-toggle:work-group:activity-neutral", | 682 | | - "activity-1", | 683 | | - "activity-2", | 684 | | - "activity-3", | | 682 | + "work-details:work-group:activity-neutral", | 685 | 683 | ]); | 686 | 684 | expect(expanded[0]).toMatchObject({ | 687 | 685 | type: "work-toggle", | |
Collapse file Copy file name to clipboardExpand all lines: apps/mobile/src/lib/threadActivity.ts +42-23Lines changed: 42 additions & 23 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,6 +6,8 @@ import type { | 6 | 6 | import { turnItemIsWorkspacePreparation } from "@t3tools/client-runtime/state/turn-item-presentation"; | 7 | 7 | import { commandProgramName } from "@t3tools/client-runtime/work-log/command-label"; | 8 | 8 | import { | | 9 | + workEntryDisplayIndicatesToolFailure, | | 10 | + resolveWorkEntryToolPresentation, | 9 | 11 | summarizeToolGroup, | 10 | 12 | toolGroupSummaryKind, | 11 | 13 | type ToolGroupSummaryKind, | @@ -870,7 +872,7 @@ function appendToolGroupRows( | 870 | 872 | : (latestInProgressActivity ?? activities.at(-1)!); | 871 | 873 | const groupSummary = summarizeToolGroup(activities.map((activity) => activity.workEntry)); | 872 | 874 | const summary = live | 873 | | - ? liveToolActivitySummary(latestActivity) | | 875 | + ? liveToolActivitySummary(latestActivity, latestInProgressActivity !== undefined) | 874 | 876 | : activities.length === 1 && !activities[0]!.toolLike | 875 | 877 | ? activities[0]!.workEntry.label | 876 | 878 | : groupSummary.summary; | @@ -886,40 +888,57 @@ function appendToolGroupRows( | 886 | 888 | summaryKind: toolGroupSummaryKind( | 887 | 889 | (live ? [latestActivity] : activities).map((activity) => activity.workEntry), | 888 | 890 | ), | 889 | | - hasFailure: groupSummary.hasFailure, | | 891 | + hasFailure: (() => { | | 892 | + const lastToolLike = activities.findLast((activity) => activity.toolLike); | | 893 | + return ( | | 894 | + lastToolLike !== undefined && workEntryDisplayIndicatesToolFailure(lastToolLike.workEntry) | | 895 | + ); | | 896 | + })(), | 890 | 897 | live, | 891 | 898 | shimmer: | 892 | 899 | isWorking && | 893 | 900 | latestActivity.lifecycleStatus === "inProgress" && | 894 | 901 | latestActivity.runId === activeRunId, | 895 | 902 | }); | 896 | 903 | if (!expanded) return; | 897 | | - for (const activity of activities) { | 898 | | - result.push({ | 899 | | - type: "activity-group", | 900 | | - id: activity.id, | 901 | | - createdAt: activity.createdAt, | 902 | | - runId: activity.runId, | 903 | | - activities: [ | 904 | | - { | 905 | | - ...activity, | 906 | | - groupedToolDetail: true, | 907 | | - live: | 908 | | - isWorking && | 909 | | - activity.id === latestActivity.id && | 910 | | - activity.lifecycleStatus === "inProgress" && | 911 | | - activity.runId === activeRunId, | 912 | | - }, | 913 | | - ], | 914 | | - }); | 915 | | - } | | 904 | + result.push({ | | 905 | + type: "activity-group", | | 906 | + id: `work-details:${groupId}`, | | 907 | + createdAt: activities[0]!.createdAt, | | 908 | + runId: activities[0]!.runId, | | 909 | + activities: activities.map((activity) => ({ | | 910 | + ...activity, | | 911 | + groupedToolDetail: true, | | 912 | + live: | | 913 | + isWorking && | | 914 | + activity.id === latestActivity.id && | | 915 | + activity.lifecycleStatus === "inProgress" && | | 916 | + activity.runId === activeRunId, | | 917 | + })), | | 918 | + }); | 916 | 919 | } | 917 | 920 |
| 918 | | -function liveToolActivitySummary(activity: ThreadFeedActivity): string { | | 921 | +function liveToolActivitySummary(activity: ThreadFeedActivity, active: boolean): string { | | 922 | + const presentation = resolveWorkEntryToolPresentation( | | 923 | + activity.workEntry, | | 924 | + active ? "inProgress" : "completed", | | 925 | + ); | | 926 | + if (presentation) return presentation.displayName; | 919 | 927 | const command = activity.workEntry.command?.trim(); | 920 | 928 | if (command) { | 921 | 929 | const program = commandProgramName(command); | 922 | | - return program ? `Running ${program}` : "Running command"; | | 930 | + const status = activity.lifecycleStatus ?? (active ? "inProgress" : "completed"); | | 931 | + const verb = | | 932 | + status === "inProgress" | | 933 | + ? "Running" | | 934 | + : status === "failed" | | 935 | + ? "Failed" | | 936 | + : status === "declined" | | 937 | + ? "Declined" | | 938 | + : status === "stopped" | | 939 | + ? "Stopped" | | 940 | + : "Ran"; | | 941 | + return `${verb} ${program ?? "command"}`; | 923 | 942 | } | 924 | 943 | return activity.detail ?? activity.summary; | 925 | 944 | } | |
Collapse file Copy file name to clipboardExpand all lines: apps/server/scripts/acp-mock-agent.ts +15-5Lines changed: 15 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -303,11 +303,18 @@ function modeState(): AcpSchema.SessionModeState { | 303 | 303 | // "grok-build" product name, and it rejects unknown ids in session/set_model. | 304 | 304 | const grokAcpModels: ReadonlyArray<AcpSchema.ModelInfo> = [ | 305 | 305 | { | 306 | | - modelId: "grok-build", | 307 | | - name: "Grok Build", | 308 | | - ...(initialGrokReasoningEffort | 309 | | - ? { _meta: { reasoningEffort: initialGrokReasoningEffort } } | 310 | | - : {}), | | 306 | + modelId: "grok-4.6", | | 307 | + name: "Grok 4.6", | | 308 | + _meta: { | | 309 | + totalContextTokens: 500_000, | | 310 | + supportsReasoningEffort: true, | | 311 | + reasoningEffort: initialGrokReasoningEffort ?? "high", | | 312 | + reasoningEfforts: [ | | 313 | + { id: "xhigh", value: "xhigh", label: "Extra High Effort", default: false }, | | 314 | + { id: "high", value: "high", label: "High Effort", default: true }, | | 315 | + { id: "low", value: "low", label: "Low Effort", default: false }, | | 316 | + ], | | 317 | + }, | 311 | 318 | }, | 312 | 319 | { modelId: "grok-mock-alt", name: "Grok Mock Alt" }, | 313 | 320 | ]; | @@ -331,6 +338,9 @@ const program = Effect.gen(function* () { | 331 | 338 | request.clientCapabilities?._meta?.parameterizedModelPicker === true; | 332 | 339 | return { | 333 | 340 | protocolVersion: 1, | | 341 | + // Grok advertises model state before any session exists; the provider | | 342 | + // health check reads it from here without authenticating. | | 343 | + _meta: { modelState: modelState() }, | 334 | 344 | agentCapabilities: { | 335 | 345 | loadSession: true, | 336 | 346 | ...(supportsSessionLifecycle | |
Collapse file Copy file name to clipboard +2-7Lines changed: 2 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { ORCHESTRATION_PROTOCOL_HEADER } from "@t3tools/contracts"; | | 2 | + | 1 | 3 | export const browserApiCorsAllowedMethods = ["GET", "POST", "OPTIONS"] as const; | 2 | 4 | export const browserApiCorsAllowedHeaders = [ | 3 | 5 | "authorization", | @@ -7,10 +9,3 @@ export const browserApiCorsAllowedHeaders = [ | 7 | 9 | "dpop", | 8 | 10 | ORCHESTRATION_PROTOCOL_HEADER, | 9 | 11 | ] as const; | 10 | | - | 11 | | -export const browserApiCorsHeaders = { | 12 | | - "access-control-allow-origin": "*", | 13 | | - "access-control-allow-methods": browserApiCorsAllowedMethods.join(", "), | 14 | | - "access-control-allow-headers": browserApiCorsAllowedHeaders.join(", "), | 15 | | -} as const; | 16 | | -import { ORCHESTRATION_PROTOCOL_HEADER } from "@t3tools/contracts"; |
Collapse file Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1406,7 +1406,7 @@ describe("AcpAdapterV2", () => { | 1406 | 1406 | instanceId, | 1407 | 1407 | model: "grok-mock-alt", | 1408 | 1408 | } satisfies ModelSelection; | 1409 | | - const originalSelection = { instanceId, model: "grok-build" } satisfies ModelSelection; | | 1409 | + const originalSelection = { instanceId, model: "grok-4.6" } satisfies ModelSelection; | 1410 | 1410 | const runtime = yield* adapter.openSession({ | 1411 | 1411 | threadId: firstThreadId, | 1412 | 1412 | providerSessionId: ProviderSessionId.make("provider-session-acp-active-setup"), | |
|