kimi-code/packages/agent-core/test
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
..
agent fix: preserve long tool output (#1062) 2026-06-24 14:42:11 +08:00
base/common feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
config feat: add workspace add-dir support (#812) 2026-06-22 19:42:13 +08:00
di feat(web): introduce Kimi web app and daemon gateway (#625) 2026-06-17 20:53:46 +08:00
errors feat(protocol): extract shared protocol package from agent-core (#612) 2026-06-10 14:03:38 +08:00
fixtures refactor(kaos): move Environment into kaos, slim package API (#147) 2026-05-28 16:50:10 +08:00
flags fix: allow obsolete experimental config entries (#584) 2026-06-09 17:00:48 +08:00
harness fix(acp): read workspace local config via local fs at session start (#992) 2026-06-23 11:19:20 +08:00
hooks refactor(agent-core): move HookEngine to sessions (#165) 2026-05-28 21:35:42 +08:00
logging fix(agent-core): route session logs exclusively to session sink (#102) 2026-05-27 13:00:17 +08:00
loop fix: classify OAuth token refresh errors by cause (#838) 2026-06-17 18:34:42 +08:00
mcp fix: preserve long tool output (#1062) 2026-06-24 14:42:11 +08:00
plugin mcp suport sse (#744) 2026-06-14 18:04:26 +08:00
profile feat: replace silent AGENTS.md truncation with a visible warning (#1040) 2026-06-24 12:26:17 +08:00
rpc feat(config): tolerate invalid config.toml sections instead of failing startup (#689) 2026-06-12 15:56:13 +08:00
services fix(web): stop auto-dismissing pending questions and approvals on a timeout (#1070) 2026-06-24 19:15:06 +08:00
session fix(agent-core): surface git context failures for explore subagents (#1067) 2026-06-24 19:59:30 +08:00
skill fix(agent-core): mark truncated skill descriptions with an ellipsis (#1064) 2026-06-24 13:20:48 +08:00
tools fix: preserve long tool output (#1062) 2026-06-24 14:42:11 +08:00
utils fix: cancel active turns during session shutdown (#661) 2026-06-11 20:52:50 +08:00
prompt-placeholders.test.ts feat: agent swarm (#424) 2026-06-08 14:26:56 +08:00