open-code-review/internal
kite 602e3bbe94 refactor(agent): split agent.go into util.go and compression.go, fix compression bugs
Extract utility functions (stripEmptyPlanBlock, stripMarkdownFences,
buildMessageXML, copyMessages, countMessagesTokens, reviewModeString,
detectGitBranch) into util.go and all compression logic into compression.go
to improve readability (agent.go: 1489 → 1114 lines).

Fix pre-existing compression bugs from commit 14adf6f:
- Return unmodified messages on compression failure instead of truncating
  to frozen zone (which discarded all conversation context)
- Check error in async compression goroutine to avoid applying failed results
- Track snapshot length to append post-snapshot messages when applying async
  compression, preventing silent message loss
- Strip old <previous_review_summary> before appending new one to prevent
  cumulative frozen zone bloat across multiple compressions
- Guard pendingJob cleanup to only clear when it matches the completed job,
  preventing accidental clearing of a newly scheduled job
- Add context.Context and 5s timeout to detectGitBranch
- Deep copy ToolCalls in copyMessages to match session/history.go
- Reuse finalCount in addNextMessage to avoid redundant token counting
2026-06-19 20:16:23 +08:00
..
agent refactor(agent): split agent.go into util.go and compression.go, fix compression bugs 2026-06-19 20:16:23 +08:00
config refactor(template): extract prompt strings into standalone .md files 2026-06-19 19:27:29 +08:00
diff test(diff): add unit tests for readWorkspaceFileForDiff 2026-06-15 11:51:51 +08:00
gitcmd perf(tool): stream file reads line-by-line to avoid full-file memory allocation 2026-06-06 20:59:05 +08:00
llm feat(llm): add glm-5.2 to z-ai provider models (#163) 2026-06-17 11:46:14 +08:00
model fix(diff): detect renamed and deleted files correctly in diff parsing (#105) 2026-06-14 22:29:02 +08:00
pathutil Fix workspace symlink diff containment (#125) 2026-06-15 00:03:36 +08:00
release fix(build): improve Windows support based on PR #13 review feedback 2026-06-02 22:37:27 +08:00
session fix(session): restrict session dir and file permissions to owner-only 2026-06-17 12:45:31 +05:30
stdout style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
suggestdiff feat: init 2026-05-20 22:03:52 +08:00
telemetry feat(llm): enable Anthropic prompt caching and fix token accounting 2026-06-06 19:26:34 +08:00
tool Fix workspace symlink diff containment (#125) 2026-06-15 00:03:36 +08:00
viewer fix(viewer): use real API token usage in session page instead of tiktoken estimates 2026-06-06 21:17:47 +08:00