Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
docs(copilot-cli): document handoff delivery and why project scope is unsupported
AkitaOnRails9e085073b353
diff --git a/docs/install.md b/docs/install.mdindex 98934017..ce8bb6e5 100644--- a/docs/install.md+++ b/docs/install.md@@ -1325,13 +1325,16 @@ rejects `matcher` on `SessionStart`, `Stop`, `SessionEnd`, and the subagentevents, and omitting it elsewhere means "every invocation". Tool output isread from `tool_result.text_result_for_llm`.-Copilot reads a top-level `additionalContext` from `SessionStart` stdout, not-Claude Code's `hookSpecificOutput` envelope, so the prior session's handoff is-not injected yet; recover it via MCP `memory_handoff_list` then-`memory_handoff_accept` with that `handoff_id`. There is no `--scope project`:-Copilot's repository hook files (`.github/hooks/*.json`) are shared with the-team and loaded by the Copilot cloud agent, so they cannot carry per-machine-script paths. `install-mcp --client copilot-cli` and `ai-memory run copilot`+The `SessionStart` hook delivers the prior session's handoff: Copilot reads a+top-level `additionalContext` from `SessionStart` stdout (not Claude Code's+`hookSpecificOutput` envelope), and the hook prints exactly that, or `{}` when+nothing is pending.++`--scope project` is intentionally unsupported for Copilot CLI. Copilot's+repository hook files (`.github/hooks/*.json`) are versioned, shared with the+team and loaded by the Copilot cloud agent, while ai-memory's hook entries+carry this machine's absolute executable and data-dir paths; committing them+would point every teammate at one person's install and server. `install-mcp --client copilot-cli` and `ai-memory run copilot`are not shipped yet; `install-mcp --client copilot` remains the VS CodeCopilot client.diff --git a/docs/support-matrix.md b/docs/support-matrix.mdindex a3720197..1558f66e 100644--- a/docs/support-matrix.md+++ b/docs/support-matrix.md@@ -34,7 +34,7 @@| Kimi Code | Supported | MCP config (`url` entry in `~/.kimi-code/mcp.json`) + lifecycle hooks (`[[hooks]]` in `~/.kimi-code/config.toml`, 10 events including subagent start/stop and `PostToolUseFailure` for tool-failure capture); both paths honor `$KIMI_CODE_HOME`. Handoffs inject via `UserPromptSubmit` stdout (Kimi Code discards `SessionStart` hook stdout); `ai-memory run kimi` adds managed workstream resume. || Kiro CLI | Supported | MCP config uses `install-mcp --client kiro-cli` (alias `kiro`) and Kiro's Bedrock-compatible schema flavor. `install-hooks --agent kiro-cli` merges v2 hooks into existing agent configs; the explicit `--agent kiro-cli-v3` target writes the incompatible standalone v3 registration. Both preserve unrelated entries, honor `$KIRO_HOME`, enforce capture exclusions, and inject pending handoffs at session start. Kiro has no true SessionEnd hook; use `ai-memory finalize-session --agent kiro-cli`, with `--session-id <uuid>` for concurrent sessions, unless it is an interactive session launched with `ai-memory run kiro`, which finalizes it automatically when it exits if the run can tie the session to itself (see [`docs/managed-workstreams.md`](managed-workstreams.md)). `ai-memory run kiro` manages v2; add `--v3`, `--mode`, or `--agent-engine v3` for version-safe v3 resume. || Pool | Hooks-only | Poolside Agent CLI (`pool`). Lifecycle-hook capture via `install-hooks --agent pool` (alias `poolside`): Pool reads project-scoped hooks from the repo-root `.poolside/settings.yaml`, so ai-memory stages the scripts and prints a ready-to-paste `hooks:` snippet rather than writing committed project files; native commands enforce capture exclusions. Five Claude-shaped events (`SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `Stop`) and no true session-end — `Stop` is a turn boundary, so run `ai-memory finalize-session --agent pool` after the final turn. `SessionStart` stdout injection is not demonstrated, so capture works but handoff injection does not — recover handoffs via MCP `memory_handoff_list` then `memory_handoff_accept` with that `handoff_id`. No first-party `install-mcp` client and no managed workstream (`ai-memory run pool`) are claimed: Pool's native session-store contract is not demonstrated (see [`docs/managed-harness-contributions.md`](managed-harness-contributions.md)). Verified against Poolside CLI v1.0.16. |-| GitHub Copilot CLI | Hooks-only | `install-hooks --agent copilot-cli` writes lifecycle hooks to `$COPILOT_HOME/hooks/ai-memory.json` (default `~/.copilot/hooks/ai-memory.json`). Configured with PascalCase event names, so Copilot sends the VS Code/Claude-compatible payload (`session_id`, `cwd`, `tool_name`, `tool_input`, `tool_result`) and native commands enforce capture exclusions; 10 events, Claude Code's nine plus `PostToolUseFailure`. Entries are flat with no `matcher`, because Copilot rejects it on `SessionStart`/`Stop`/`SessionEnd` and subagent events. Copilot reads a top-level `additionalContext` on `SessionStart` rather than Claude Code's envelope, so capture works but handoff injection does not yet — recover handoffs via MCP `memory_handoff_list` then `memory_handoff_accept` with that `handoff_id`. No `--scope project`: Copilot's repository hook files (`.github/hooks/*.json`) are shared with the team and the cloud agent, so they cannot carry per-machine script paths. `install-mcp --client copilot-cli` and `ai-memory run copilot` are follow-ups (#1040). The bare `--client copilot` alias keeps meaning VS Code Copilot. |+| GitHub Copilot CLI | Hooks-only | `install-hooks --agent copilot-cli` writes lifecycle hooks to `$COPILOT_HOME/hooks/ai-memory.json` (default `~/.copilot/hooks/ai-memory.json`). Configured with PascalCase event names, so Copilot sends the VS Code/Claude-compatible payload (`session_id`, `cwd`, `tool_name`, `tool_input`, `tool_result`) and native commands enforce capture exclusions; 10 events, Claude Code's nine plus `PostToolUseFailure`. Entries are flat with no `matcher`, because Copilot rejects it on `SessionStart`/`Stop`/`SessionEnd` and subagent events. The `SessionStart` hook delivers the prior session's handoff through Copilot's top-level `additionalContext`. `--scope project` is intentionally unsupported: Copilot's repository hook files (`.github/hooks/*.json`) are versioned and shared with the team and the cloud agent, so they cannot carry this machine's absolute executable and data-dir paths. `install-mcp --client copilot-cli` and `ai-memory run copilot` are follow-ups (#1040). The bare `--client copilot` alias keeps meaning VS Code Copilot. || VS Code Copilot | MCP-only | `.vscode/mcp.json` for Copilot agent mode; no lifecycle hooks (Copilot does not expose them yet). || Zed | MCP-only | Native remote MCP under `context_servers` in Zed's user `settings.json`; no lifecycle hooks or managed-workstream support. || Muse Code | MCP-only | `install-mcp --client muse` merges a native streamable-HTTP entry with bearer `headers` into the snake_case `mcp_servers` map of `~/.config/muse/settings.json`, preserving sibling servers. The writer adds the mandatory `"schema_version": 1` when absent (without it every `muse` command fails at startup) and never rewrites an existing value, and it sets `"mode": "optional"` because Muse's default `required` aborts the whole run when the server is unreachable. Skills need no extra step: Muse reads `~/.agents/skills`, which `install-skills` already writes. Lifecycle capture and managed workstreams are not claimed — Muse documents a hook surface, but the output contract of its `SessionStart` event is not specified. |