Skip to content

Commit c96f75a

Browse files
Merge remote-tracking branch 'origin/main' into fix/issue-25723
2 parents d287732 + 5127de8 commit c96f75a

25 files changed

Lines changed: 1095 additions & 402 deletions

File tree

‎apps/mobile/src/features/threads/thread-list-v2-items.tsx‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,10 @@ import {
6666
import { QueuedMessageIcon } from "./queued-message-icon";
6767
import { shouldRecedeThreadRow } from "./thread-row-emphasis";
6868
import { ThreadSearchMatchExcerpt } from "./thread-search-match";
69+
import { useScaledTextRole } from "../settings/appearance/useScaledTextRole";
6970
import { PullRequestGlyph } from "../pull-requests/pullRequestGlyphs";
7071
import { pullRequestStatus } from "../pull-requests/pullRequestStatus";
7172

72-
const TITLE_FAVICON_SIZE = 15;
73-
// Centers the favicon on the first line of the text-base title.
74-
const TITLE_FAVICON_OFFSET = 4;
75-
// Lines below the title start where the title text does.
76-
const TITLE_TEXT_INSET = TITLE_FAVICON_SIZE + 8;
77-
7873
interface StatusLabel {
7974
readonly label: string;
8075
readonly icon: AppSymbolName;
@@ -603,7 +598,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
603598
readonly searchQuery?: string;
604599
readonly simultaneousSwipeGesture?: ComponentProps<typeof ThreadSwipeable>["simultaneousWith"];
605600
}) {
606-
const { width: windowWidth } = useWindowDimensions();
601+
const { width: windowWidth, fontScale } = useWindowDimensions();
602+
const titleTypography = useScaledTextRole("body");
603+
const metadataTypography = useScaledTextRole("label");
604+
const projectIconSize = titleTypography.fontSize * 1.25 * fontScale;
605+
const machineIconSize = metadataTypography.fontSize * fontScale;
606+
const titleLineHeight = titleTypography.lineHeight * fontScale;
607607
const {
608608
thread,
609609
variant,
@@ -995,17 +995,17 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
995995
? `Opens the thread. Swipe left to ${primaryAction.label.toLowerCase()}.`
996996
: `Opens the thread. Swipe left for ${primaryAction.label.toLowerCase()} and snooze actions.`;
997997

998-
const titleTextInset = props.project ? TITLE_TEXT_INSET : 0;
998+
const titleTextInset = props.project ? projectIconSize + 8 : 0;
999999
const cardContent = (
10001000
<>
10011001
<View className="flex-row items-start gap-2">
10021002
{props.project ? (
1003-
<View style={{ marginTop: TITLE_FAVICON_OFFSET }}>
1003+
<View className="justify-center" style={{ height: titleLineHeight }}>
10041004
<ProjectFavicon
10051005
environmentId={thread.environmentId}
10061006
faviconPath={props.project.faviconPath}
10071007
projectIcon={props.project.projectIcon}
1008-
size={TITLE_FAVICON_SIZE}
1008+
size={projectIconSize}
10091009
projectTitle={props.project.title}
10101010
workspaceRoot={props.project.workspaceRoot}
10111011
/>
@@ -1023,7 +1023,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
10231023
>
10241024
{thread.title}
10251025
</Text>
1026-
<View className="flex-row items-center gap-1.5" style={{ marginTop: 3 }}>
1026+
<View className="flex-row items-center gap-1.5" style={{ minHeight: titleLineHeight }}>
10271027
{props.hasQueuedMessages ? <QueuedMessageIcon selected={selected} /> : null}
10281028
{pinnedRow ? (
10291029
<SymbolView
@@ -1134,7 +1134,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
11341134
{props.environmentMachine ? (
11351135
<EnvironmentMachineSymbol
11361136
kind={props.environmentMachine}
1137-
size={11}
1137+
size={machineIconSize}
11381138
tintColorClassName={
11391139
selected
11401140
? selectedThreadRowColors.mutedIconTintClassName
@@ -1295,7 +1295,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
12951295
environmentId={thread.environmentId}
12961296
faviconPath={props.project.faviconPath}
12971297
projectIcon={props.project.projectIcon}
1298-
size={15}
1298+
size={projectIconSize}
12991299
projectTitle={props.project.title}
13001300
workspaceRoot={props.project.workspaceRoot}
13011301
/>

‎apps/server/scripts/acp-mock-agent.ts‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const emitToolCalls = process.env.T3_ACP_EMIT_TOOL_CALLS === "1";
2424
const emitInterleavedAssistantToolCalls =
2525
process.env.T3_ACP_EMIT_INTERLEAVED_ASSISTANT_TOOL_CALLS === "1";
2626
const emitV2Fidelity = process.env.T3_ACP_EMIT_V2_FIDELITY === "1";
27+
const emitNotice = process.env.T3_ACP_EMIT_NOTICE === "1";
2728
const vibeRetryOutcome = process.env.T3_ACP_VIBE_RETRY_OUTCOME;
2829
const emitGenericToolPlaceholders = process.env.T3_ACP_EMIT_GENERIC_TOOL_PLACEHOLDERS === "1";
2930
const emitPostSettleMonitorFlow = process.env.T3_ACP_EMIT_POST_SETTLE_MONITOR_FLOW === "1";
@@ -1170,6 +1171,30 @@ const program = Effect.gen(function* () {
11701171
return yield* finishPrompt(requestedSessionId, "end_turn");
11711172
}
11721173

1174+
if (emitNotice) {
1175+
// A notice in fx 0.0.14's shape for a skipped skill, between two chunks of one message.
1176+
const chunk = (text: string) =>
1177+
writeJsonRpcNotification("session/update", {
1178+
sessionId: requestedSessionId,
1179+
update: {
1180+
sessionUpdate: "agent_message_chunk",
1181+
messageId: "mock-notice-message",
1182+
content: { type: "text", text },
1183+
},
1184+
});
1185+
chunk("before the notice, ");
1186+
writeJsonRpcNotification("session/update", {
1187+
sessionId: requestedSessionId,
1188+
update: {
1189+
sessionUpdate: "notice",
1190+
severity: "info",
1191+
title: "skill discovery warning: candidate was skipped because its metadata is invalid",
1192+
},
1193+
});
1194+
chunk("after the notice");
1195+
return yield* finishPrompt(requestedSessionId, "end_turn");
1196+
}
1197+
11731198
if (emitV2Fidelity) {
11741199
yield* agent.client.sessionUpdate({
11751200
sessionId: `${requestedSessionId}-child`,

‎apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,88 @@ describe("AcpAdapterV2", () => {
20582058
}).pipe(Effect.provide(layerTest), Effect.scoped),
20592059
);
20602060

2061+
it.effect("advertises ACP session notices and shows them as system notices", () =>
2062+
Effect.gen(function* () {
2063+
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
2064+
const path = yield* Path.Path;
2065+
const selfInvocation = yield* resolveSelfInvocation();
2066+
const mockAgentPath = yield* path.fromFileUrl(
2067+
new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
2068+
);
2069+
const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>();
2070+
const instanceId = ProviderInstanceId.make("acp-test-notice");
2071+
const adapter = yield* makeAcpAdapterV2({
2072+
instanceId,
2073+
flavor: {
2074+
driver: ACP_TEST_DRIVER,
2075+
capabilities: AcpProviderCapabilitiesV2,
2076+
makeRuntime: makeMockRuntime({
2077+
childProcessSpawner,
2078+
mockAgentPath,
2079+
protocolEvents,
2080+
environment: { T3_ACP_EMIT_NOTICE: "1" },
2081+
}),
2082+
},
2083+
selfInvocation,
2084+
});
2085+
const threadId = ThreadId.make("thread-acp-notice");
2086+
const runtimePolicy = ProviderAdapter.ProviderAdapterV2RuntimePolicy.make({
2087+
runtimeMode: "full-access",
2088+
interactionMode: "default",
2089+
cwd: process.cwd(),
2090+
});
2091+
const modelSelection = { instanceId, model: "default" } as const;
2092+
const runtime = yield* adapter.openSession({
2093+
threadId,
2094+
providerSessionId: ProviderSessionId.make("provider-session-acp-notice"),
2095+
modelSelection,
2096+
runtimePolicy,
2097+
});
2098+
const providerThread = yield* runtime.ensureThread({
2099+
threadId,
2100+
modelSelection,
2101+
runtimePolicy,
2102+
});
2103+
const now = yield* DateTime.now;
2104+
yield* runtime.startTurn(
2105+
makeTurnInput({ threadId, providerThread, instanceId, runtimePolicy, now, ordinal: 1 }),
2106+
);
2107+
const items = Array.from(
2108+
yield* runtime.events.pipe(
2109+
Stream.takeUntil((event) => event.type === "turn.terminal"),
2110+
Stream.runCollect,
2111+
),
2112+
).flatMap((event) => (event.type === "turn_item.updated" ? [event.turnItem] : []));
2113+
2114+
const initialize = Array.from(yield* Queue.takeAll(protocolEvents)).find(
2115+
(event) => event.direction === "outgoing" && rawProtocolMethod(event) === "initialize",
2116+
);
2117+
assert.deepEqual(
2118+
initialize === undefined
2119+
? undefined
2120+
: Reflect.get(
2121+
Object(rawProtocolRequestParam(initialize, "clientCapabilities")),
2122+
"session",
2123+
),
2124+
{ notices: {} },
2125+
);
2126+
const title =
2127+
"skill discovery warning: candidate was skipped because its metadata is invalid";
2128+
assert.deepEqual(
2129+
items.flatMap((item) => (item.type === "system_notice" ? [item.message] : [])),
2130+
[title],
2131+
);
2132+
const replies = new Map(
2133+
items.flatMap((item) => (item.type === "assistant_message" ? [[item.id, item.text]] : [])),
2134+
);
2135+
assert.deepEqual(
2136+
[...replies.values()],
2137+
["before the notice, after the notice"],
2138+
"a notice neither joins the reply nor splits it",
2139+
);
2140+
}).pipe(Effect.provide(layerTest), Effect.scoped),
2141+
);
2142+
20612143
it.effect("projects ACP v2 fidelity updates into first-class orchestration items", () =>
20622144
Effect.gen(function* () {
20632145
const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;

‎apps/server/src/orchestration-v2/testkit/fixtures/grok_auto_blocked_command/grok_transcript.ndjson‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{"type":"transcript_start","provider":"grok","protocol":"acp.ndjson-jsonrpc","version":"1","scenario":"grok_auto_blocked_command","metadata":{"generatedBy":"live-grok-recorder","grokVersion":"1.0.41","normalization":"Session ids are fixed UUIDs, the workspace is <workspace>, HOME is /home/grok-replay and the recording user is grok-replay. T3-owned prompt text, MCP servers and initialize params other than clientCapabilities and _meta are <any>. Personal skills, machine identity, account settings and announcement broadcasts are removed, as are responses to Grok-internal request ids that T3's protocol drops. Timestamps are kept as recorded.","droppedFrames":5}}
2-
{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"<any>","capabilities":"<any>","_meta":{"clientType":"extension"},"clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"elicitation":{"form":{}}},"clientInfo":"<any>"}}}
2+
{"type":"expect_outbound","label":"request:initialize","frame":{"kind":"request","method":"initialize","params":{"protocolVersion":2,"info":"<any>","capabilities":"<any>","_meta":{"clientType":"extension"},"clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"session":{"notices":{}},"elicitation":{"form":{}}},"clientInfo":"<any>"}}}
33
{"type":"emit_inbound","label":"response:initialize","frame":{"kind":"response","method":"initialize","result":{"protocolVersion":1,"agentCapabilities":{"loadSession":true,"promptCapabilities":{"image":false,"audio":false,"embeddedContext":true},"mcpCapabilities":{"http":true,"sse":true},"sessionCapabilities":{"list":{},"resume":{},"close":{}},"auth":{},"_meta":{"x.ai/fs_notify":true,"x.ai/hooks":{"blockingEvents":["pre_tool_use","stop","subagent_stop"],"decisions":["deny","block"],"stopSignals":["continue","stopReason","additionalContext"]},"x.ai/capabilities":{"toolOverrides":{"x_keyword_search":true,"x_semantic_search":true,"x_user_search":false,"x_thread_fetch":false}}}},"authMethods":[{"id":"cached_token","name":"cached_token","description":"Cached token from ~/.grok/auth.json"},{"id":"grok.com","name":"Grok","description":"Sign in with Grok"}],"_meta":{"grokShell":true,"defaultAuthMethodId":"cached_token","x.ai/mcp/sdk":true,"x.ai/pluginDirs":true,"currentWorkingDirectory":"<workspace>","agentVersion":"1.0.41","agentId":"00000000-0000-4000-8000-000000000000","agentInstanceId":"00000000-0000-4000-8000-000000000000","hostname":"grok-replay","modelState":{"currentModelId":"grok-4.7","availableModels":[{"modelId":"grok-4.7","name":"Grok 4.7","description":"SpaceXAI's latest frontier model","_meta":{"totalContextTokens":500000,"agentType":"grok-build-plan","supportsReasoningEffort":true,"reasoningEffort":"high","reasoningEfforts":[{"id":"xhigh","value":"xhigh","label":"Extra High","description":"Maximum reasoning for the hardest tasks.","default":false},{"id":"high","value":"high","label":"High","description":"Thorough reasoning and quality. Recommended.","default":true},{"id":"medium","value":"medium","label":"Medium","description":"Strong quality with a faster turnaround.","default":false},{"id":"low","value":"low","label":"Low","description":"Fastest responses. Best for simple tasks.","default":false}]}},{"modelId":"grok-4.7-build-fast","name":"Grok 4.7 Fast","description":"Fast variant. 2x the price.","_meta":{"totalContextTokens":500000,"agentType":"grok-build-plan","supportsReasoningEffort":true,"reasoningEffort":"high","reasoningEfforts":[{"id":"xhigh","value":"xhigh","label":"Extra High","description":"Maximum reasoning for the hardest tasks.","default":false},{"id":"high","value":"high","label":"High","description":"Thorough reasoning and quality. Recommended.","default":true},{"id":"medium","value":"medium","label":"Medium","description":"Strong quality with a faster turnaround.","default":false},{"id":"low","value":"low","label":"Low","description":"Fastest responses. Best for simple tasks.","default":false}]}},{"modelId":"grok-4.6","name":"Grok 4.6","_meta":{"totalContextTokens":500000,"agentType":"grok-build-plan","supportsReasoningEffort":true,"reasoningEffort":"high","reasoningEfforts":[{"id":"xhigh","value":"xhigh","label":"Extra High","description":"Highest effort and reasoning level","default":false},{"id":"high","value":"high","label":"High","description":"Higher implementation quality with extensive reasoning","default":true},{"id":"medium","value":"medium","label":"Medium","description":"Balanced effort with standard implementation and testing","default":false},{"id":"low","value":"low","label":"Low","description":"Quick, fast implementations","default":false}]}},{"modelId":"grok-4.5","name":"Grok 4.5","_meta":{"totalContextTokens":500000,"agentType":"grok-build-plan","supportsReasoningEffort":true,"reasoningEffort":"high","reasoningEfforts":[{"id":"high","value":"high","label":"High","description":"Highest implementation quality with extensive reasoning","default":true},{"id":"medium","value":"medium","label":"Medium","description":"Balanced effort with standard implementation and testing","default":false},{"id":"low","value":"low","label":"Low","description":"Quick, fast implementations","default":false}]}}]},"mcpServers":[],"mcpApps":false,"metadata":null,"availableCommands":[{"name":"compact","description":"Compress conversation history to save context window","input":{"hint":"optional context about what to preserve"}},{"name":"always-approve","description":"Toggle always-approve mode (skip all permission prompts)","input":{"hint":"on|off"}},{"name":"context","description":"Show context window usage and session stats","input":null},{"name":"session-info","description":"Show session details (model, turns, context usage)","input":null},{"name":"deep-research","description":"Research with bounded parallel agents, cross-check evidence, and write a cited report","input":{"hint":"<query>"}},{"name":"workflow","description":"Launch a saved workflow, list runs, or manage a run (pause, resume, stop, save)","input":{"hint":"<name> [--agent-budget N] [--effort LEVEL] [args] | runs | pause|resume|stop|save [name]"}},{"name":"goal","description":"Set, manage, or check an autonomous goal","input":{"hint":"<objective> [--budget <tokens>] | status | pause | resume | clear"}}],"cancelRewind":true,"sessionRecap":true,"feedbackTraceOffer":false,"voiceMode":true}}}}
44
{"type":"expect_outbound","label":"request:session/new","frame":{"kind":"request","method":"session/new","params":{"cwd":"<workspace>","mcpServers":"<any>"}}}
55
{"type":"emit_inbound","label":"notification:_x.ai/mcp/servers_updated","frame":{"kind":"notification","method":"_x.ai/mcp/servers_updated","params":{"mcpServers":[]}}}

0 commit comments

Comments
 (0)