Commit 5974ba9
fix(review): capture Claude reviewer model via transcript backfill (#1373)
Claude review subprocesses run via `claude -p` don't reliably report a model
through lifecycle hooks (the ModelUpdate path is flaky in headless mode), so
per-session checkpoint metadata landed with "model": "" for Claude reviewer
sessions, while codex/pi reviewers record theirs. Root cause: ClaudeCodeAgent
did not implement agent.ModelExtractor, so condense's sessionStateBackfillModel
fallback (AsModelExtractor -> ExtractModel) was a no-op for Claude; the model
relied solely on the flaky hook path.
Implement ExtractModel on ClaudeCodeAgent: parse the transcript and return the
last non-empty model from an assistant line (mirrors pi/copilotcli/factoryai).
Condense already calls this when state.ModelName == "", so review (and any
hook-missed) Claude sessions now record a non-empty model deterministically.
Verified against real recorded data: a real agent_review row in
entire/checkpoints/v1 with model="" (skills=[/review]) — running the new
ExtractModel on that session's stored transcript recovers "claude-opus-4-7",
which is exactly the value the condense backfill writes. Surfaces in
entire.io's per-reviewer attribution (entirehq/entire.io#2271).
Note: the transcript carries the base model id ("claude-opus-4-7"), not the
hook's context-window variant ("claude-opus-4-7[1m]"), so backfilled models
omit the [1m] suffix — a correct, non-empty id, slightly less precise.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 41d9aa9acef61 parent 69cc486 commit 5974ba9
2 files changed
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
91 | 120 | | |
92 | 121 | | |
93 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
0 commit comments