Skip to content

Commit 82feb77

Browse files
Merge branch 'main' into fix/snoozed-wake-icon-alignment
2 parents bfccd57 + 9e20194 commit 82feb77

127 files changed

Lines changed: 13076 additions & 761 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ github:jappyjan
3838
github:justsomelegs
3939
github:UtkarshUsername
4040
github:SunkenInTime
41+
github:bil0000

‎AGENTS.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
114114
- Never make a PR unless the developer explicitly asks you to do so.
115115
- Conventional commit titles, plain language: `fix(web): new threads no longer spike CPU`.
116116
- Body: the problem in a sentence or two, then how you fixed it. End with the model and harness that did the work.
117-
- **Rebase onto latest main before opening.** Stale branches conflict and burn a review round.
118117
- UI changes need before/after images. Motion or timing needs a short video.
119118
- One concern per PR. If the description says "also", split it.
120119
- When babysitting: poll checks and comments newer than the last push, verify each bot finding against the source, fix real ones, dismiss false positives with a written reason. Stay quiet when nothing is new. Stop when the bots are green on the latest commit.

‎apps/mobile/src/features/threads/ComposerCommandPopover.tsx‎

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { isLiquidGlassSupported, LiquidGlassView } from "@callstack/liquid-glass";
21
import type { ComposerTriggerKind } from "@t3tools/shared/composerTrigger";
32
import type { ServerProviderSkill, ServerProviderSlashCommand } from "@t3tools/contracts";
43
import { SymbolView } from "../../components/AppSymbol";
54
import { memo } from "react";
65
import { Pressable, ScrollView, useColorScheme, View, type ViewStyle } from "react-native";
76

87
import { AppText as Text } from "../../components/AppText";
8+
import { GlassSurface } from "../../components/GlassSurface";
99
import { PierreEntryIcon } from "../../components/PierreEntryIcon";
1010
export type ComposerCommandItem =
1111
| {
@@ -56,33 +56,14 @@ function PopoverSurface(props: {
5656
...props.style,
5757
};
5858

59-
if (isLiquidGlassSupported) {
60-
return (
61-
<LiquidGlassView
62-
effect="clear"
63-
interactive={false}
64-
tintColor={props.isDarkMode ? "rgba(30,30,32,0.95)" : "rgba(255,255,255,0.92)"}
65-
colorScheme={props.isDarkMode ? "dark" : "light"}
66-
style={baseStyle}
67-
>
68-
{props.children}
69-
</LiquidGlassView>
70-
);
71-
}
72-
7359
return (
74-
<View
75-
style={[
76-
baseStyle,
77-
{
78-
backgroundColor: props.isDarkMode ? "rgba(44,44,46,0.96)" : "rgba(255,255,255,0.96)",
79-
borderWidth: 1,
80-
borderColor: props.isDarkMode ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.06)",
81-
},
82-
]}
60+
<GlassSurface
61+
glassEffectStyle="clear"
62+
tintColor={props.isDarkMode ? "rgba(30,30,32,0.95)" : "rgba(255,255,255,0.92)"}
63+
style={baseStyle}
8364
>
8465
{props.children}
85-
</View>
66+
</GlassSurface>
8667
);
8768
}
8869

‎apps/server/src/auth/RpcAuthorization.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ export const RPC_REQUIRED_SCOPES = {
5858
[WS_METHODS.pullRequestsActivity]: AuthOrchestrationReadScope,
5959
[WS_METHODS.pullRequestsDiffFileContents]: AuthOrchestrationReadScope,
6060
[WS_METHODS.pullRequestsRunAction]: AuthOrchestrationOperateScope,
61+
[WS_METHODS.pullRequestsUpdate]: AuthOrchestrationOperateScope,
6162
[WS_METHODS.pullRequestsComment]: AuthOrchestrationOperateScope,
63+
[WS_METHODS.pullRequestsUpdateComment]: AuthOrchestrationOperateScope,
6264
[WS_METHODS.pullRequestsSubmitReview]: AuthOrchestrationOperateScope,
6365
[WS_METHODS.pullRequestsReplyToThread]: AuthOrchestrationOperateScope,
6466
[WS_METHODS.pullRequestsSetThreadResolution]: AuthOrchestrationOperateScope,
67+
[WS_METHODS.pullRequestsSetReaction]: AuthOrchestrationOperateScope,
6568
// Read scope like the reads it un-caches: refreshing is part of reading, and a read-only
6669
// client pressing refresh must not be told it may not look again.
6770
[WS_METHODS.pullRequestsInvalidate]: AuthOrchestrationReadScope,

‎apps/server/src/git/GitManager.test.ts‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import * as Duration from "effect/Duration";
99
import * as Effect from "effect/Effect";
1010
import * as FileSystem from "effect/FileSystem";
1111
import * as Layer from "effect/Layer";
12+
import * as Logger from "effect/Logger";
1213
import * as Option from "effect/Option";
1314
import * as PlatformError from "effect/PlatformError";
15+
import * as References from "effect/References";
1416
import * as Scope from "effect/Scope";
1517
import { ChildProcessSpawner } from "effect/unstable/process";
1618
import { expect } from "vite-plus/test";
@@ -1386,6 +1388,58 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => {
13861388
}),
13871389
);
13881390

1391+
it.effect("status logs actionable provider detail without exposing the upstream cause", () =>
1392+
Effect.gen(function* () {
1393+
const repoDir = yield* makeTempDir("t3code-git-manager-");
1394+
yield* initRepo(repoDir);
1395+
yield* runGit(repoDir, ["checkout", "-b", "feature/status-rate-limited"]);
1396+
const remoteDir = yield* createBareRemote();
1397+
yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
1398+
yield* runGit(repoDir, ["push", "-u", "origin", "feature/status-rate-limited"]);
1399+
1400+
const upstreamCause = "GraphQL rate limit for user ID 51714798 and token secret-value";
1401+
const { manager } = yield* makeManager({
1402+
ghScenario: {
1403+
failWith: new GitHubCli.GitHubCliRateLimitError({
1404+
command: "gh",
1405+
cwd: repoDir,
1406+
cause: new Error(upstreamCause),
1407+
}),
1408+
},
1409+
});
1410+
const logs: Array<{ message: string; annotations: Record<string, unknown> }> = [];
1411+
const logger = Logger.make<unknown, void>(({ fiber, message }) => {
1412+
logs.push({
1413+
message: String(message),
1414+
annotations: { ...fiber.getRef(References.CurrentLogAnnotations) },
1415+
});
1416+
});
1417+
1418+
const status = yield* manager
1419+
.status({ cwd: repoDir })
1420+
.pipe(Effect.provide(Logger.layer([logger], { mergeWithExisting: false })));
1421+
1422+
expect(status.pr).toBeNull();
1423+
const warning = logs.find((entry) => entry.message.includes("PR lookup failed"));
1424+
expect(warning?.annotations).toMatchObject({
1425+
operation: "lookupStatusPr",
1426+
branch: "feature/status-rate-limited",
1427+
errorTag: "SourceControlProviderError",
1428+
provider: "github",
1429+
providerOperation: "listChangeRequests",
1430+
providerCommand: "gh",
1431+
errorDetail:
1432+
"GitHub API rate limit exceeded. Run `gh api rate_limit` to inspect the quota and reset time.",
1433+
});
1434+
const loggedText = [
1435+
warning?.message ?? "",
1436+
...Object.values(warning?.annotations ?? {}).map(String),
1437+
].join("\n");
1438+
expect(loggedText).not.toContain(upstreamCause);
1439+
expect(loggedText).not.toContain("secret-value");
1440+
}),
1441+
);
1442+
13891443
it.effect("status keeps the last known PR when a later lookup fails", () =>
13901444
Effect.gen(function* () {
13911445
const repoDir = yield* makeTempDir("t3code-git-manager-");

‎apps/server/src/git/GitManager.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import * as Option from "effect/Option";
1212
import * as Order from "effect/Order";
1313
import * as Path from "effect/Path";
1414
import * as Ref from "effect/Ref";
15+
import * as Schema from "effect/Schema";
1516
import {
1617
GitActionProgressEvent,
1718
GitActionProgressPhase,
@@ -28,6 +29,7 @@ import {
2829
type VcsStatusRemoteResult,
2930
VcsStatusResult,
3031
ModelSelection,
32+
SourceControlProviderError,
3133
type SourceControlWritingStyleSettings,
3234
} from "@t3tools/contracts";
3335
import {
@@ -113,6 +115,7 @@ const PR_LOOKUP_CACHE_TTL = Duration.minutes(2);
113115
const PR_LOOKUP_FAILURE_BASE_TTL = Duration.seconds(20);
114116
const PR_LOOKUP_FAILURE_MAX_TTL = Duration.minutes(15);
115117
const PR_LOOKUP_CACHE_CAPACITY = 2_048;
118+
const isSourceControlProviderError = Schema.is(SourceControlProviderError);
116119

117120
/**
118121
* How long a failed PR lookup is cached, given the number of consecutive
@@ -1048,6 +1051,14 @@ export const make = Effect.gen(function* () {
10481051
typeof error === "object" && error !== null && "_tag" in error
10491052
? String(error._tag)
10501053
: typeof error,
1054+
...(isSourceControlProviderError(error)
1055+
? {
1056+
provider: error.provider,
1057+
providerOperation: error.operation,
1058+
providerCommand: error.command ?? "unknown",
1059+
errorDetail: error.detail,
1060+
}
1061+
: {}),
10511062
}),
10521063
Effect.andThen(resolveBranchHeadContext(cwd, details)),
10531064
Effect.map((headContext) =>

‎apps/server/src/provider/CodexDeveloperInstructions.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,25 @@ Example:
120120
plan content
121121
</proposed_plan>
122122
123-
plan content should be human and agent digestible. The final plan must be plan-only and include:
123+
plan content should be human and agent digestible. The final plan must be plan-only, concise by default, and include:
124124
125125
* A clear title
126126
* A brief summary section
127127
* Important changes or additions to public APIs/interfaces/types
128128
* Test cases and scenarios
129129
* Explicit assumptions and defaults chosen where needed
130130
131+
When possible, prefer a compact structure with 3-5 short sections, usually: Summary, Key Changes or Implementation Changes, Test Plan, and Assumptions. Do not include a separate Scope section unless scope boundaries are genuinely important to avoid mistakes.
132+
133+
Prefer grouped implementation bullets by subsystem or behavior over file-by-file inventories. Mention files only when needed to disambiguate a non-obvious change, and avoid naming more than 3 paths unless extra specificity is necessary to prevent mistakes. Prefer behavior-level descriptions over symbol-by-symbol removal lists. For v1 feature-addition plans, do not invent detailed schema, validation, precedence, fallback, or wire-shape policy unless the request establishes it or it is needed to prevent a concrete implementation mistake; prefer the intended capability and minimum interface/behavior changes.
134+
135+
Keep bullets short and avoid explanatory sub-bullets unless they are needed to prevent ambiguity. Prefer the minimum detail needed for implementation safety, not exhaustive coverage. Within each section, compress related changes into a few high-signal bullets and omit branch-by-branch logic, repeated invariants, and long lists of unaffected behavior unless they are necessary to prevent a likely implementation mistake. Avoid repeated repo facts and irrelevant edge-case or rollout detail. For straightforward refactors, keep the plan to a compact summary, key edits, tests, and assumptions. If the user asks for more detail, then expand.
136+
131137
Do not ask "should I proceed?" in the final output. The user can easily switch out of Plan mode and request implementation if you have included a \`<proposed_plan>\` block in your response. Alternatively, they can decide to stay in Plan mode and continue refining the plan.
132138
133139
Only produce at most one \`<proposed_plan>\` block per turn, and only when you are presenting a complete spec.
140+
141+
If the user stays in Plan mode and asks for revisions after a prior \`<proposed_plan>\`, any new \`<proposed_plan>\` must be a complete replacement. If the user indicates that the prior plan is not acceptable but does not provide enough information to produce a complete replacement, address the concern and continue planning without producing a \`<proposed_plan>\` block. If the follow-up neither requires changes nor calls the plan into question (e.g. clarifying question), answer it before the block, then reproduce the prior \`<proposed_plan>\` unchanged.
134142
${T3_CODE_BROWSER_TOOL_INSTRUCTIONS}
135143
</collaboration_mode>`;
136144

@@ -142,7 +150,7 @@ Your active mode changes only when new developer instructions with a different \
142150
143151
## request_user_input availability
144152
145-
The \`request_user_input\` tool is unavailable in Default mode. If you call it while in Default mode, it will return an error.
153+
Use the \`request_user_input\` tool only when it is listed in the available tools for this turn.
146154
147155
In Default mode, strongly prefer making reasonable assumptions and executing the user's request rather than stopping to ask questions. If you absolutely must ask a question because the answer cannot be discovered from local context and a reasonable assumption would be risky, ask the user directly with a concise plain-text question. Never write a multiple choice question as a textual assistant message.
148156
${T3_CODE_BROWSER_TOOL_INSTRUCTIONS}

‎apps/server/src/pullRequest/AzureDevOpsPullRequestCli.test.ts‎

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,40 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => {
342342
}),
343343
);
344344

345+
it.effect("stores the squash choice with an auto-completion, as a merge now does", () =>
346+
Effect.gen(function* () {
347+
mockedExecute.mockReturnValue(Effect.succeed(output("{}")));
348+
const cli = yield* AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli;
349+
350+
yield* cli.runPullRequestAction({
351+
cwd: "/w",
352+
number: 42,
353+
action: "enable-auto-merge",
354+
mergeMethod: "squash",
355+
});
356+
357+
expect(argsOfCall(0)).toEqual([
358+
"repos",
359+
"pr",
360+
"update",
361+
"--detect",
362+
"true",
363+
"--id",
364+
"42",
365+
"--auto-complete",
366+
"true",
367+
"--squash",
368+
"true",
369+
"--only-show-errors",
370+
"--output",
371+
"json",
372+
]);
373+
}),
374+
);
375+
345376
it.effect.each([
377+
{ action: "enable-auto-merge", expected: ["--auto-complete", "true", "--squash", "false"] },
378+
{ action: "disable-auto-merge", expected: ["--auto-complete", "false"] },
346379
{ action: "draft", expected: ["--draft", "true"] },
347380
{ action: "ready", expected: ["--draft", "false"] },
348381
{ action: "close", expected: ["--status", "abandoned"] },
@@ -370,6 +403,79 @@ layer("AzureDevOpsPullRequestCli.layer", (it) => {
370403
}),
371404
);
372405

406+
it.effect.each([
407+
{ name: "a title", rewrite: { title: "Add the page" }, expected: ["--title=Add the page"] },
408+
{
409+
name: "a description",
410+
rewrite: { body: "Why the page changed" },
411+
expected: ["--description=Why the page changed"],
412+
},
413+
{
414+
name: "both",
415+
rewrite: { title: "Add the page", body: "Why the page changed" },
416+
expected: ["--title=Add the page", "--description=Why the page changed"],
417+
},
418+
] as const)("rewrites $name, sending nothing it was not given", ({ rewrite, expected }) =>
419+
Effect.gen(function* () {
420+
mockedExecute.mockReturnValue(Effect.succeed(output("{}")));
421+
const cli = yield* AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli;
422+
423+
yield* cli.updatePullRequest({ cwd: "/w", number: 42, ...rewrite });
424+
425+
expect(argsOfCall(0)).toEqual([
426+
"repos",
427+
"pr",
428+
"update",
429+
"--detect",
430+
"true",
431+
"--id",
432+
"42",
433+
...expected,
434+
"--only-show-errors",
435+
"--output",
436+
"json",
437+
]);
438+
}),
439+
);
440+
441+
it.effect("sends a description that starts with a dash as one value, not as a flag", () =>
442+
Effect.gen(function* () {
443+
mockedExecute.mockReturnValue(Effect.succeed(output("{}")));
444+
const cli = yield* AzureDevOpsPullRequestCli.AzureDevOpsPullRequestCli;
445+
446+
yield* cli.updatePullRequest({
447+
cwd: "/w",
448+
number: 42,
449+
body: "- rewrote the page\n- kept the rest",
450+
});
451+
452+
// One argument, so the leading dash of an ordinary bullet list never reaches az as a flag,
453+
// and the whole text stays together where `--description` would otherwise take several.
454+
expect(argsOfCall(0)).toContain("--description=- rewrote the page\n- kept the rest");
455+
}),
456+
);
457+
458+
it.effect("rewrites through the provider, which says it takes one", () =>
459+
Effect.gen(function* () {
460+
mockedExecute.mockReturnValue(Effect.succeed(output("{}")));
461+
const provider = yield* AzureDevOpsPullRequestProvider.make;
462+
463+
// False for a remark because nothing here can post one, so there is none to rewrite.
464+
expect(provider.capabilities.edit).toEqual({ changeRequest: true, comment: false });
465+
assert.isDefined(provider.updateChangeRequest);
466+
yield* provider.updateChangeRequest({
467+
cwd: "/w",
468+
repository: "web",
469+
host: "dev.azure.com",
470+
number: 42,
471+
title: "Add the page",
472+
});
473+
474+
expect(argsOfCall(0)).toContain("--title=Add the page");
475+
expect(argsOfCall(0)).not.toContain("--description");
476+
}),
477+
);
478+
373479
it.effect("reads the conversation through the REST API, pinned to a version", () =>
374480
Effect.gen(function* () {
375481
mockedExecute.mockReturnValueOnce(

0 commit comments

Comments
 (0)