History

fix(server): stop showing commit/push/PR notices as errors in the work log (#5559)

Theo Browne committed 3 months ago

Commit 0ec4fbc1 parent ea50b692 files · +27 −3Browse files

Unified · Split

2 files
  1. apps/server/src/provider/Layers/ClaudeAdapter.test.ts +18 −0
  2. apps/server/src/provider/Layers/ClaudeAdapter.ts +9 −3
apps/server/src/provider/Layers/ClaudeAdapter.test.ts+18−0
@@ -2021,6 +2021,24 @@ describe("ClaudeAdapterLive", () => { · 2020 unmodified lines
20212021 session_id: "session",
20222022 uuid: "roster",
20232023 },
2024+ {
2025+ type: "system",
2026+ subtype: "vcs_state_changed",
2027+ kind: "push",
2028+ cwd: "/tmp/worktree",
2029+ session_id: "session",
2030+ uuid: "vcs",
2031+ },
2032+ {
2033+ type: "system",
2034+ subtype: "code_change_published",
2035+ provider: "github",
2036+ url: "https://github.com/pingdotgg/t3code/pull/1",
2037+ repo: "pingdotgg/t3code",
2038+ identifier: "1",
2039+ session_id: "session",
2040+ uuid: "ccp",
2041+ },
20242042 {
20252043 type: "system",
20262044 subtype: "task_updated",
apps/server/src/provider/Layers/ClaudeAdapter.ts+9−3
@@ -3034,9 +3034,15 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* ( · 3033 unmodified lines
30343034 // error rows in client work logs. `background_tasks_changed` is a roster
30353035 // snapshot ({tasks: [...]}) — the task_* lifecycle events carry the
30363036 // authoritative per-agent data and the typed background_tasks control
3037− // request is the reconciliation source.
3038− if ((message.subtype as string) === "background_tasks_changed") {
3039− return;
3037+ // request is the reconciliation source. `vcs_state_changed`
3038+ // ({kind: commit|push|rebase}) and `code_change_published`
3039+ // ({provider, url, repo}) are informational CLI notices; the work log
3040+ // already shows the underlying git/gh tool calls.
3041+ switch (message.subtype as string) {
3042+ case "background_tasks_changed":
3043+ case "vcs_state_changed":
3044+ case "code_change_published":
3045+ return;
30403046 }
30413047
30423048 switch (message.subtype) {