feat(acp): make saved conversations portable so Orka can carry them between turns
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start with the session persistence and resume code in runtimes/common/agentkit_serve_common/acp.py added by #38, then read docs/orka.md and the existing tests for those flows. Add coverage for portable-file validation, resume in a new working directory, and the initialize metadata; done means the specified round-trip succeeds and invalid or corrupt files fail clearly.
索引モデルが issue の本文から書いたものです。
説明
Depends on #38. #38 makes AgentKit save each conversation to a file and reopen it with
session/resume. This issue makes that file safe for Orka to move to a different machine between turns.Orka side: orka-agents/orka#754, part of orka-agents/orka#587
Problem
Orka runs AgentKit agents as a child process, one process per conversation. For coding work, Orka deletes that process and its folder after every turn, then starts a fresh one for the next turn. Today the fresh process gets only a shortened text copy of the chat that Orka keeps itself. Long conversations lose context.
Orka already solves this for Codex in orka-agents/orka#732. After each turn it saves Codex's own conversation file, and before the next turn it puts that file into the new process's folder and asks Codex to reopen the conversation. Orka wants to do the same for AgentKit.
#38 gets AgentKit most of the way. It saves the conversation to $XDG_STATE_HOME/agentkit/sessions/<session-id>.json and adds session/resume. But #38 only plans for a restart in the same folder. Orka needs three more things before it can carry the file from one turn to the next.
- A stable, versioned format. Orka stores the file and hands it back later, maybe to a newer AgentKit image. AgentKit has to recognize its own files and refuse ones it can't read.
- Resume in a different folder. Every new Orka runtime gets a new folder, so the working directory path changes on every turn. A saved file must not tie the conversation to the old path.
- A compact file. Orka stores at most 512 KiB per saved conversation, and anything larger falls back to the shortened copy.
What
Change the file that #38 introduces so Orka can store it and restore it into a fresh process.
- Add a format version and enough identity to the file to reject a file from the wrong agent.
- Let
session/resumework when the process runs in a different working directory than the one that saved the file. - Tell Orka at startup that this AgentKit image writes portable files, so Orka knows it can save and restore them.
- Document the format.
Out of scope:
- The Orka side, meaning saving the file after a turn and putting it back before the next one. orka-agents/orka tracks that.
session/loadandsession/fork.
Why
AgentKit conversations in Orka would keep their full history across turns, the same as Codex after orka-agents/orka#732. AgentKit's format is the simplest of all the agents Orka runs, and this team controls it, which makes it the safest second agent for Orka's checkpoint feature.
How
Start from the code #38 adds in runtimes/common/agentkit_serve_common/acp.py.
-
File contents. Write a JSON object instead of a bare list:
{ "format": "agentkit.session", "formatVersion": 1, "sessionId": "agentkit-<32 hex characters>", "agentConfigurationDigest": "sha256:<64 hex characters>", "turns": [ { "role": "user", "text": "..." }, { "role": "assistant", "text": "..." } ] }agentConfigurationDigestis the SHA-256 of the exact bytes of/agent/agent.yaml, the same value Orka registers for the runtime. Keep only user and assistant text inturns. Never write the working directory, environment variables, tokens, model URLs or provider settings. -
Checks on resume. Before using a file, check that
formatandformatVersionare known,sessionIdmatches the requested session, andagentConfigurationDigestmatches the running agent. If any check fails, return a JSON-RPC error that names the failed check. Orka then falls back to its shortened copy. Don't try to upgrade or repair a file. -
Different working directory.
session/resumeshould checkcwdagainst the current process's working directory, the same waysession/newdoes. It must not compare it with the directory that was in use when the file was saved. -
Size. Orka stores at most 512 KiB per conversation and falls back to its shortened copy when a file is larger. AgentKit doesn't need to enforce that limit, because the file still helps a same-folder restart from #38. Write the JSON without indentation so conversations stay under the limit for longer.
-
Advertise the format. Add a
_metaentry to theinitializeresponse, for example{"agentkit": {"sessionFormatVersion": 1}}. Orka will only save and restore AgentKit conversations when it sees this. -
Docs. Add a short section to
docs/orka.mddescribing the file, its location, the checks, and the size limit.
Done when
- A test saves a conversation, copies only the file into a brand-new
XDG_STATE_HOME, starts a new process in a different working directory, resumes the session, and gets the earlier history. - Resume fails with a clear error for an unknown format or version, a different session ID, a different agent configuration, or a corrupt file.
- The
initializeresponse includes the format version. - The file contains no secrets and no working directory path.
- 主要言語
- Python
- スター
- 7
- フォーク
- 5
- 平均マージ
- 3時間 39分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
orka-agents/agentkit のほかの issue
-
fix(pydantic-ai): CI fails with newest pydantic-ai (unexpected 'history' argument)対応中かも @gambtho が 30 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
orka-agents/agentkit#77 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
orka-agents/agentkit#76 · コメント 3 件 ·
-
area/build area/orka area/runtime blocked enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
orka-agents/agentkit#69 ·
-
area/build area/orka area/runtime enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
orka-agents/agentkit#68 ·
-
area/build enhancement testing
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
orka-agents/agentkit#65 ·
orka-agents/agentkit の issue をすべて見る
似ている issue
-
bot-triaged module: correctness (silent) module: fft triage review
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
conda-forge/zarpaint-feedstock#8 · コメント 1 件 · リアクション 1 件 ·
-
plot_prediction colorbar shows a 0-1 range instead of the data range対応中かも @nikhil3495 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mllam/neural-lam#902 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
didi/helixharness#28 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
DaoCloud/DaoCloud-docs#7839 ·
メンテナーはふだん 1 日以内に返信