agent-orchestrator/packages/plugins
Harsh Batheja bc8b50d2db fix(plugin-kimicode): correct session layout discovered via smoke test
Installing kimi-cli 1.38.0 locally (\`uv tool install kimi-cli\`) and running
it once revealed the plugin's session-discovery logic was built on wrong
assumptions about the on-disk layout.

Observed layout (kimi-cli 1.38.0):

  ~/.kimi/sessions/<md5(cwd)>/<session-uuid>/
    context.jsonl  — conversation history
    wire.jsonl     — turn events (TurnBegin/TurnEnd with user_input payload)

Differences from my original assumptions:

- Sessions are nested under \`sessions/\` (not direct subdirectories of
  \`~/.kimi/\`).
- The workspace is identified by an MD5 hash of the absolute path, not by
  a \`cwd\` field stored in a state file.
- There is no \`state.json\`. No \`title\`, \`model\`, or \`cost\` is persisted.
- The session ID is the UUID directory name and is accepted as-is by
  \`kimi --resume <uuid>\`.
- The old \`--continue\` fallback is unnecessary — if we found the directory,
  we always know its UUID.

Fixes:

- \`findKimiSessionMatch\` now computes \`md5(workspacePath)\` with node:crypto
  and lists \`~/.kimi/sessions/<hash>/\` directly. No more full-tree scan of
  \`~/.kimi/\`, no more \`readFile\` of a fictional \`state.json\`.
- \`getKimiLiveSignalMtime\` keeps the parallel \`Promise.all\` stat of
  context.jsonl + wire.jsonl (the only files that exist).
- \`getSessionInfo\` streams the first \`TurnBegin\` out of wire.jsonl as a
  best-effort summary, with a 1 MB byte ceiling. agentSessionId is the UUID.
- \`getRestoreCommand\` drops the \`--continue\` fallback branch — a found dir
  always has a usable UUID.

Verified end-to-end against the real kimi-cli 1.38 binary on this machine:
- \`detect()\` → true
- \`getLaunchCommand\` output parses cleanly when run with \`--help\`
- \`getSessionInfo\` extracts the actual first user prompt ("say hello")
- \`getRestoreCommand\` produces the same UUID kimi itself prints as the
  resume hint: \`kimi -r 6ec34626-aedf-4659-a061-c5fbfa4cf166\`

Tests remain at 75 green. Coverage is now against real on-disk layouts
using temp directories with MD5-hashed bucket names — no mock-structure
drift from reality.
2026-04-22 22:17:08 +05:30
..
agent-aider fix: model missing activity evidence explicitly (#122) 2026-04-17 19:28:56 +05:30
agent-claude-code fix: improve agent plugin cost accounting and restore safety 2026-04-18 13:56:59 +05:30
agent-codex fix: restore permissionless codex workers with bypass 2026-04-19 19:59:16 +05:30
agent-cursor fix: model missing activity evidence explicitly (#122) 2026-04-17 19:28:56 +05:30
agent-kimicode fix(plugin-kimicode): correct session layout discovered via smoke test 2026-04-22 22:17:08 +05:30
agent-opencode fix: model missing activity evidence explicitly (#122) 2026-04-17 19:28:56 +05:30
notifier-composio Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
notifier-desktop Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
notifier-discord Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
notifier-openclaw Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
notifier-slack Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
notifier-webhook Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
runtime-process Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
runtime-tmux Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
scm-github fix: finish PR #1300 major follow-up fixes 2026-04-18 12:35:15 +05:30
scm-gitlab fix: finish PR #1300 major follow-up fixes 2026-04-18 12:35:15 +05:30
terminal-iterm2 fix: model missing activity evidence explicitly (#122) 2026-04-17 19:28:56 +05:30
terminal-web fix: model missing activity evidence explicitly (#122) 2026-04-17 19:28:56 +05:30
tracker-github fix(cli): stop writing broken yaml when `ao start` runs in a new folder 2026-04-14 22:13:01 +05:30
tracker-gitlab refactor: clean up redundant requireRepo calls and nullish coalescing 2026-04-14 22:13:02 +05:30
tracker-linear Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
workspace-clone Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30
workspace-worktree Merge pull request #1180 from yyovil/add/type-resolution 2026-04-13 19:56:36 +05:30