fix(cli): t3 triage points agents at log files that exist (#13685)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-09-25 19:15:06 -07:00
1 parent 20885cecf7
commit 7c901a37c4
8 files changed
+23 -14

No files matched your search

-1
View File
@@ -508,7 +508,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
resolved.terminalLogsDir,
resolved.attachmentsDir,
resolved.worktreesDir,
path.dirname(resolved.serverLogPath),
path.dirname(resolved.serverTracePath),
]) {
expect(yield* fs.exists(directory)).toBe(true);
+6 -1
View File
@@ -27,6 +27,7 @@ import * as Schema from "effect/Schema";
import { Command, Flag } from "effect/unstable/cli";
import packageJson from "../../package.json" with { type: "json" };
import * as BootService from "../cloud/bootService.ts";
import * as ServerConfig from "../config.ts";
import { resolveBaseDir } from "../os-jank.ts";
import { isProcessAlive, readPersistedServerRuntimeState } from "../serverRuntimeState.ts";
@@ -201,7 +202,11 @@ export const triageCommand = Command.make("triage", {
dbPath: paths.dbPath,
settingsPath: paths.settingsPath,
logsDir: paths.logsDir,
serverLogPath: paths.serverLogPath,
// The server writes no log file of its own. Service installs and the
// desktop app capture its output. The glob covers every desktop backend
// (such as WSL) and rotated copies; names come from DesktopObservability.ts.
serviceLogPath: path.join(paths.logsDir, BootService.BOOT_SERVICE_LOG_FILE),
desktopBackendLogGlob: path.join(paths.logsDir, "server-child*.log*"),
serverTracePath: paths.serverTracePath,
providerEventLogPath: paths.providerEventLogPath,
terminalLogsDir: paths.terminalLogsDir,
+4 -1
View File
@@ -52,7 +52,8 @@ it("context file carries every path the playbook depends on", () => {
dbPath: "/home/u/.t3/userdata/state.sqlite",
settingsPath: "/home/u/.t3/userdata/settings.json",
logsDir: "/home/u/.t3/userdata/logs",
serverLogPath: "/home/u/.t3/userdata/logs/server.log",
serviceLogPath: "/home/u/.t3/userdata/logs/boot-service.log",
desktopBackendLogGlob: "/home/u/.t3/userdata/logs/server-child*.log*",
serverTracePath: "/home/u/.t3/userdata/logs/server.trace.ndjson",
providerEventLogPath: "/home/u/.t3/userdata/logs/provider/events.log",
terminalLogsDir: "/home/u/.t3/userdata/logs/terminals",
@@ -63,6 +64,8 @@ it("context file carries every path the playbook depends on", () => {
});
assert.include(context, "/home/u/.t3/userdata/state.sqlite");
assert.include(context, "/home/u/.t3/userdata/logs/server.trace.ndjson");
assert.include(context, "/home/u/.t3/userdata/logs/boot-service.log");
assert.include(context, "/home/u/.t3/userdata/logs/server-child*.log*");
assert.include(context, "/home/u/.t3/userdata/logs/provider/events.log");
assert.include(context, "/home/u/.t3/userdata/secrets");
assert.include(context, "/home/u/.t3/source");
+7 -4
View File
@@ -71,8 +71,9 @@ different code depending on it:
Then work from evidence, not assumption. In rough order of value:
- The server log and the trace file (\`server.trace.ndjson\`) around the time of the
problem. Recent failures usually leave a trail here.
- The trace file (\`server.trace.ndjson\`) around the time of the problem, plus the
service log or desktop backend logs from the context file if they exist. Recent
failures usually leave a trail here.
- The provider event log, for problems with claude/codex/cursor sessions.
- The SQLite database. Read it freely, but only write when a write is necessary
to fix the problem the user described, and get their explicit permission
@@ -176,7 +177,8 @@ export interface TriageContextInput {
readonly dbPath: string;
readonly settingsPath: string;
readonly logsDir: string;
readonly serverLogPath: string;
readonly serviceLogPath: string;
readonly desktopBackendLogGlob: string;
readonly serverTracePath: string;
readonly providerEventLogPath: string;
readonly terminalLogsDir: string;
@@ -205,7 +207,8 @@ Generated by \`t3 triage\` at ${input.generatedAt}.
- Database (SQLite; write only with the user's explicit permission): ${input.paths.dbPath}
- Settings: ${input.paths.settingsPath}
- Logs dir: ${input.paths.logsDir}
- Server log: ${input.paths.serverLogPath}
- Service log (systemd/launchd service installs only): ${input.paths.serviceLogPath}
- Desktop backend logs (glob; one file per backend plus rotated copies; written only when a backend crashes or fails to start): ${input.paths.desktopBackendLogGlob}
- Server trace (ndjson): ${input.paths.serverTracePath}
- Provider event log: ${input.paths.providerEventLogPath}
- Terminal logs: ${input.paths.terminalLogsDir}