Stop paying the multimodal tax. Your AI agent keeps every image it has seen but only sends the ones it needs: lighter chats, no endless reconnecting, no starting over. Works with Codex, Claude Code, Cline, Gemini CLI, OpenCode, WorkBuddy and more. Install once, forget it.
TypeScript ai-agentsai-imageclaude-codeclaude-code-pluginclinecodexcodex-plugincomputer-usecontext-engineeringcontext-managementdeveloper-toolsgemini-cliimage-generationmcpmultimodalmultimodal-aiopencodeqwen-codetoken-optimizationvision-language-model
chore(release): prepare v0.11.0
chipfighteraf61a6f6fb43
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 3cb15b0..eabdb68 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "codex-attachment-manager","displayName": "Context Attachment Manager",- "version": "0.10.0",+ "version": "0.11.0","description": "Choose which images from a Claude Code session's history go out with the next message. Unchecked images become short placeholders; the session and the conversation stay the same.","author": {"name": "chipfighter"diff --git a/AGENTS.md b/AGENTS.mdindex f8bf383..946c83f 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -12,7 +12,7 @@ Context Attachment Manager(上下文素材管理器,2026-10-11 前叫 Codex- [docs/v0.7/plan.md](docs/v0.7/plan.md):v0.7 方案,Codex 的子代理和旁聊也自动选图(已发布 0.7.0)。- [docs/v0.8/plan.md](docs/v0.8/plan.md):v0.8 方案,模型给每张图写特征行、压缩后照样拿对图,面板改成搜索加缩略图(已发布 0.8.0)。- [docs/v0.10/plan.md](docs/v0.10/plan.md):v0.10 方案,压缩和续接之后照样拿回之前的图,编号不变(已发布 0.10.0;关卡结果见方案第 3 节)。-- [docs/v0.11/plan.md](docs/v0.11/plan.md):v0.11 方案,把插件拆成接入层、核心层、面板层,其他 Agent 平台只接核心、不带面板(第 1–8 步已在本机 main 上做完,没有推送)。+- [docs/v0.11/plan.md](docs/v0.11/plan.md):v0.11 方案,把插件拆成接入层、核心层、面板层,其他 Agent 平台只接核心、不带面板(已发布 0.11.0)。- [docs/history/v0.1/](docs/history/v0.1/):v0.1 的开发记录(原方案、任务记录、各阶段报告、最初的构想),只作参考,不作依据。- [CHANGELOG.md](CHANGELOG.md):每个版本的更新记录,发布时就是 Release 说明。- [eval/README_CN.md](eval/README_CN.md):评测(英文版 [eval/README.md](eval/README.md)),装插件和不装插件的对比:方法、结果和复现步骤。这一份是 Codex 里的关键帧对话;Claude Code 里压缩两次再分叉的长任务在 [eval/long-task/](eval/long-task/README_CN.md)。diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b71040a..8f88521 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,22 +2,43 @@When a version is released, its section here becomes the GitHub release notes.-## [Unreleased]+## [0.11.0] - 2026-11-02-Images Codex opens get their file names more often, and never someone else's.+The plugin now works beyond Codex and Claude. Ten more agents leave earlier images out of each message and fetch back the one they need, your agent can install the plugin by itself, and switching models in Codex with a tool such as cc-switch no longer turns it off.++### What's new++- **Ten more agents.** WorkBuddy, OpenCode, Gemini CLI, pi, DeepSeek Harness, Qwen Code, Cline, Kilo Code, goose and Cherry Studio. Images from earlier turns stay out of your messages, and the model pulls back the one it needs by its number. There is no panel on these agents: it works on its own. They are new and were not tested on the agents themselves yet, so please [tell us](https://github.com/chipfighter/context-attachment-manager/issues) how it goes.+- **Your agent installs it for you.** Paste the sentence from the README to the agent you use. It finds out which agent it is running in from that agent's own signs, not from which model it is, sets the plugin up for that one, and keeps a record so it can be undone.+- **Switch models freely in Codex.** When a tool such as cc-switch points Codex at another provider, the plugin connects again within a moment, to the provider you picked, so your images keep being managed. Turn the plugin off in the panel to stop this.### Fixed- **File names for images Codex opens.** When Codex opened an image through a path it built in code (a folder plus the file name, for example), the image got no name in the panel or in the list after a compaction, so you could not refer to it by its file name. It now gets its name whenever the file name is written in the code.- **No more names on the wrong image.** When Codex opened several images in one step and the name of one could not be told, the next one's name could land on it, and images the model fetched back in the same step could take a name too. A name now goes only to the image it belongs to; when that is unclear, the image gets none.+### After updating++- Restart Codex, and reopen Claude sessions that were open, so they use the new version.+- On another agent, paste the install sentence from the README to it, or follow [INSTALL.md](https://github.com/chipfighter/context-attachment-manager/blob/main/INSTALL.md#other-agents).+### How we tested-- Unit tests, and the image names in this machine's 163 Codex tasks read with the old and the new version: 20 images got their name, none got a different one, and the 10 that lost theirs had a wrong one (mostly a folder name).+- Unit tests (338), including every request format the new agents use and what installing writes to each agent's settings and puts back.+- Model tests in Codex: Auto-select passed all 20 checks in Chinese and in English, and the feature notes all 18. In the compaction test the model opened two images in a loop, and their file names were not known; 0.10.0 misses them the same way.+- A live test in Claude Desktop: earlier images were left out, and the model fetched one back by its number.+- The image names in this machine's 163 Codex tasks, read with the old and the new version: 20 images got their name, none got a different one, and the 10 that lost theirs had a wrong one (mostly a folder name).+- The ten new agents were not run: their adapters follow each agent's code and docs.<details><summary>Technical details</summary>+- The code is now in three layers (docs/v0.11/plan.md): a core that knows no platform, the panel (Codex desktop and Claude Desktop only), and a thin adapter per platform. A layer test keeps them apart; 668 rewrite cases stay byte for byte what they were; one contract test checks each request-format translator: OpenAI Responses, OpenAI Chat Completions (new), Anthropic Messages and Gemini (new).+- On the new agents the engine reads the images from the requests themselves, gives them ids by content, and keeps them in the data folder for `cam_view_image`. Automatic selection is always on; feature lines are off (a terminal would show them). A session is the one the agent's header names, else `x-cam-session` from our pi extension, else the first prompt.+- `cam detect` reads the variables each agent sets for its shell commands (`CODEX_THREAD_ID`, `CLAUDECODE`, `CODEBUDDY`, `OPENCODE`, `GEMINI_CLI`, `PI_SESSION_ID`, `DSH_SHELL`, `QWEN_CODE`, `CLINE_ACTIVE`, `KILO`, `GOOSE_TERMINAL`); `cam connect <agent> --apply` writes the base URL and the MCP server into the agent's settings and records each changed value for `cam disconnect`. It never copies a settings file, since those often hold API keys. goose (YAML) and Cherry Studio (settings in the app) get printed steps.+- DeepSeek Harness gets a dsh bundle that turns dsh's own `image-offload` row off and offloads earlier turns' images at each new turn, keeping dsh's over-budget offload as a fallback.+- The engine stays running while a plugin service of any agent checks in, not only while Codex or Claude runs. Session ids no longer have to be UUIDs.+- Codex: when config.toml no longer routes through the engine but the user enabled it, the engine routes it again to the provider now set (watched file, and a check every 15 s; three times in ten minutes stops it).- The engine reads the `path` of each `view_image` call in code-mode source without running it, and takes its last string when that is an image file name: `p + "a.png"`, `` `${dir}/a.png` `` and `join(dir, "a.png")` give `a.png`; `p + name`, a bare `".png"`, `?:` and `||` give none.- Images that `cam_view_image` returned in the same code are copies, known by the line before them, and take no name; the other images follow the calls in order only when their count matches the number of calls.diff --git a/docs/spec.md b/docs/spec.mdindex 5155364..6f63c03 100644--- a/docs/spec.md+++ b/docs/spec.md@@ -1,6 +1,6 @@# 规格:Context Attachment Manager(上下文素材管理器)-> 本文件是目标、范围、约束和验收标准的唯一事实来源(2026-09-24 经用户、Claude、Codex 三方确认),描述当前版本 v0.10.0,以后随版本更新。v0.4 加的 Claude 桌面 Code 接入,相关内容都标着“v0.4”;它的关卡、任务和验收步骤见 [v0.4/](v0.4/)。v0.5 加的 Claude Code 压缩后保留图片标着“v0.5”,方案和实测见 [v0.5/plan.md](v0.5/plan.md)。v0.6 的默认开启自动选图和 Claude 桌面版自动打开面板标着“v0.6”,见 [v0.6/plan.md](v0.6/plan.md)。v0.7 的 Codex 子代理和旁聊也自动选图标着“v0.7”,见 [v0.7/plan.md](v0.7/plan.md)。v0.8 的特征行(压缩后照样拿对图)和重做的面板(凭印象找图)标着“v0.8”,见 [v0.8/plan.md](v0.8/plan.md)。v0.9 把两平台的服务线路分开,并接管兼容中转;技术做法见 [design.md](design.md) 第 2、5、12 节。v0.10 让两个平台在压缩之后(Claude 还包括续接之后)照样拿回之前的图,标着“v0.10”,见 [v0.10/plan.md](v0.10/plan.md)。项目 2026-10-11 由 Codex Attachment Manager 改名,因为不再只给 Codex 用(用户定);安装用的标识(`codex-attachment-manager`)和数据目录不变,已装的用户照常升级。v0.11(进行中)把插件拆成接入层、核心层、面板层,并接入 WorkBuddy,见 [v0.11/plan.md](v0.11/plan.md);做完之前,本文件描述的行为仍是 v0.10.0 的。+> 本文件是目标、范围、约束和验收标准的唯一事实来源(2026-09-24 经用户、Claude、Codex 三方确认),描述当前版本 v0.11.0,以后随版本更新。v0.4 加的 Claude 桌面 Code 接入,相关内容都标着“v0.4”;它的关卡、任务和验收步骤见 [v0.4/](v0.4/)。v0.5 加的 Claude Code 压缩后保留图片标着“v0.5”,方案和实测见 [v0.5/plan.md](v0.5/plan.md)。v0.6 的默认开启自动选图和 Claude 桌面版自动打开面板标着“v0.6”,见 [v0.6/plan.md](v0.6/plan.md)。v0.7 的 Codex 子代理和旁聊也自动选图标着“v0.7”,见 [v0.7/plan.md](v0.7/plan.md)。v0.8 的特征行(压缩后照样拿对图)和重做的面板(凭印象找图)标着“v0.8”,见 [v0.8/plan.md](v0.8/plan.md)。v0.9 把两平台的服务线路分开,并接管兼容中转;技术做法见 [design.md](design.md) 第 2、5、12 节。v0.10 让两个平台在压缩之后(Claude 还包括续接之后)照样拿回之前的图,标着“v0.10”,见 [v0.10/plan.md](v0.10/plan.md)。项目 2026-10-11 由 Codex Attachment Manager 改名,因为不再只给 Codex 用(用户定);安装用的标识(`codex-attachment-manager`)和数据目录不变,已装的用户照常升级。v0.11 把插件拆成接入层、核心层、面板层,再接入十个只接核心、不带面板的 Agent 平台,标着“v0.11”,见 [v0.11/plan.md](v0.11/plan.md)。> 技术方案见 [design.md](design.md)。v0.1 的开发记录(原方案、任务记录、各阶段报告、最初的构想)归档在 [history/v0.1/](history/v0.1/),只作参考。## 1. 目标diff --git a/docs/v0.11/plan.md b/docs/v0.11/plan.mdindex fa56cbc..b31a2e4 100644--- a/docs/v0.11/plan.md+++ b/docs/v0.11/plan.md@@ -1,6 +1,6 @@# v0.11 方案:拆成接入层、核心层、面板层,接入其他 Agent 平台-> 状态:用户 2026-11-02 确认方案(第 7 节)。第 1–8 步已做完,在本机 main 上,没有推送;剩 Claude 桌面版实测和发布,之后改 README、定仓库名字、简介、标签,做视频和图片(第 7 节)。规格以 [spec.md](../spec.md) 为准,实现见 [design.md](../design.md),对外的接入说明是 [ADAPTERS.md](../../ADAPTERS.md)。本机的摸底记录和参考项目的笔记只在 `local/`,不进仓库。+> 状态:用户 2026-11-02 确认方案(第 7 节)。第 1–9 步已做完:Codex 自测和 Claude 桌面版实测通过(压缩自测里两张图没认出名字,0.10.0 一样),2026-11-02 发布 0.11.0。接下来改 README、定仓库名字、简介、标签,做视频和图片(第 7 节)。规格以 [spec.md](../spec.md) 为准,实现见 [design.md](../design.md),对外的接入说明是 [ADAPTERS.md](../../ADAPTERS.md)。本机的摸底记录和参考项目的笔记只在 `local/`,不进仓库。## 1. 背景与目标diff --git a/plugin/.codex-plugin/plugin.json b/plugin/.codex-plugin/plugin.jsonindex 6e06aa4..895dd88 100644--- a/plugin/.codex-plugin/plugin.json+++ b/plugin/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "codex-attachment-manager",- "version": "0.10.0",+ "version": "0.11.0","description": "Choose which images from a Codex task's history go out with the next message. Unchecked images become short placeholders; the task and the conversation stay the same.","author": {"name": "chipfighter"diff --git a/plugin/src/panel/panel.html b/plugin/src/panel/panel.htmlindex dc2ebe4..8419600 100644--- a/plugin/src/panel/panel.html+++ b/plugin/src/panel/panel.html@@ -1584,7 +1584,7 @@// ---- start: handshake, then Codex sends its own cam_panel result; poll so new images show up ----if (window.matchMedia?.("(prefers-color-scheme: dark)").matches) document.documentElement.dataset.theme = "dark";applyLanguage();- request("ui/initialize", { protocolVersion: "2026-01-26", appInfo: { name: "codex-attachment-manager", version: "0.10.0" }, appCapabilities: {} })+ request("ui/initialize", { protocolVersion: "2026-01-26", appInfo: { name: "codex-attachment-manager", version: "0.11.0" }, appCapabilities: {} }).then((init) => { applyHost(init?.hostContext); post({ method: "ui/notifications/initialized", params: {} }); reportFrame(); }).catch(() => {}).finally(() => setTimeout(() => { if (!S.data) refresh(); }, 1200));