kimi-code/packages
Kai 0e227ba18a
fix(agent-core): surface git context failures for explore subagents (#1067)
* fix(agent-core): surface git context failures for explore subagents

collectGitContext collapsed every git failure (spawn error, non-zero exit, timeout) into null, so explore subagents silently lost git context with no signal. Now a definitive 'not a git repository' injects an explicit unavailable signal so the subagent does not waste turns probing git history, while other failures are logged and surface as an empty block. The block is all-or-nothing so a partial snapshot (e.g. a timed-out status making a dirty tree look clean) is never shown.

* fix(agent-core): use rev-parse for branch to support git < 2.22

`git branch --show-current` was added in Git 2.22 and fails (exit 129) on older Git even in a valid repository. Because the branch probe is fatal, this dropped the whole git-context block for older-Git users. Switch to `git rev-parse --abbrev-ref HEAD`, which is supported across Git versions, and filter the `HEAD` output produced in detached-HEAD state.

* fix(agent-core): show whatever git info is available in explore context

Git probes fail in perfectly normal states — no `origin` remote, no commits yet (unborn branch), detached HEAD, older Git — so a failed probe no longer aborts the whole collection. Each probe is now best-effort: failures are logged and their section is omitted, and the block is dropped only when nothing useful was collected. Branch is read via `symbolic-ref --short HEAD`, which works in unborn repositories and on older Git; it fails in detached-HEAD state, where the Branch section is just omitted.
2026-06-24 19:59:30 +08:00
..
acp-adapter ci: release packages (#911) 2026-06-22 21:39:21 +08:00
agent-core fix(agent-core): surface git context failures for explore subagents (#1067) 2026-06-24 19:59:30 +08:00
kaos perf(kaos): optimize large file reads (#971) 2026-06-23 15:07:40 +08:00
kimi-migration-legacy feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
kosong ci: release packages (#803) 2026-06-16 21:23:58 +08:00
migration-legacy ci: release packages (#911) 2026-06-22 21:39:21 +08:00
node-sdk feat: replace silent AGENTS.md truncation with a visible warning (#1040) 2026-06-24 12:26:17 +08:00
oauth fix: classify OAuth token refresh errors by cause (#838) 2026-06-17 18:34:42 +08:00
protocol fix(web): stop auto-dismissing pending questions and approvals on a timeout (#1070) 2026-06-24 19:15:06 +08:00
server fix(web): stop auto-dismissing pending questions and approvals on a timeout (#1070) 2026-06-24 19:15:06 +08:00
server-e2e fix(web): stop auto-dismissing pending questions and approvals on a timeout (#1070) 2026-06-24 19:15:06 +08:00
telemetry feat: rework permission decision policies (#26) 2026-05-27 20:07:24 +08:00