Python edits to filesystem.writeFile-created files are reverted by shadow reconciliation
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 20/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
調査の方向性
Start by reading service_owned_python_filesystem_rpc_request and compare the Python Write handling with the wire WriteFile handler that mirrors bytes into the staging tree. The issue says a regression is being prepared for regular writes, read-modify-write, and atomic replacement; verify that host reads after execution preserve Python's edits. A linked open pull request already addresses this work.
索引モデルが issue の本文から書いたものです。
説明
Problem
Python edits to a file seeded with vm.filesystem.writeFile() can succeed and be visible inside the Python execution, then silently revert to the API-seeded bytes when the host reads the file after execution.
This is the Python VFS bridge counterpart of #1961. The JavaScript fix in #1981 is present in the tested source, but Python uses a different write handler. Related: the shell/WASM report #1901 is still open. This report is specifically about Python writes, not the shell-to-Python child-process issue #2012.
Reproduction
With a VM in which Python execution is available:
await vm.filesystem.mkdir('/workspace', { recursive: true });
await vm.filesystem.writeFile(
'/workspace/data.txt', new TextEncoder().encode('original\n'),
);
const result = await vm.python.execute(`
from pathlib import Path
p = Path('/workspace/data.txt')
p.write_text('EDITED\\n')
print(p.read_text(), end='')
`, { output: { capture: 'all' } });
console.log(result.stdout); // EDITED\n
console.log(new TextDecoder().decode(
await vm.filesystem.readFile('/workspace/data.txt'),
)); // original\n -- unexpected
Expected: both reads return EDITED\n. Actual: Python sees its edit and exits successfully, but the following filesystem API read returns original\n; subsequent executions also see the reverted data. A read-modify-write (p.write_text(p.read_text() + 'added\\n')) has the same problem. Seeding a fresh file through Python rather than through the filesystem API avoided the stale API-created shadow in our tests.
Verification
- Reproduced with the published 0.2.22 packages on Linux arm64, including embedded
AgentOs.create()without HTTP, Rivet actors, or PostgreSQL. That setup used a command-registration workaround to enable Python; this report starts after Python executes successfully. - Independently reproduced against unpatched upstream source at
c3698e6a60be0a6fed61d411779930e0a7753fc8using the native-sidecar Rust wire harness andExecuteRequest { runtime: Python, ... }. This bypasses SDK interpreter-command registration entirely. - The new regression fails with
left: "original\n",right: "EDITED\n"on its first post-execution host read. The bridge bundle was built from that checkout; no application storage service is needed.
Suspected cause
The wire WriteFile handler mirrors bytes into the VM's root staging/shadow tree. service_owned_python_filesystem_rpc_request handles Python Write by updating only the kernel VFS. Subsequent shadow-to-kernel reconciliation imports the unchanged staging copy and overwrites the newer Python bytes. The JavaScript mirroring change in #1981 does not run on this Python RPC path.
I am preparing a focused fix and regressions for Python writes, including read-modify-write and atomic replacement. Python append-position/truncate behavior and shell/WASM shadow writes are separate from this fix.
- 主要言語
- Rust
- スター
- 4.8k
- フォーク
- 270
- 平均マージ
- 13時間 37分
- マージ済み PR(30日)
- 48
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rivet-dev/agentos のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rivet-dev/agentos#2087 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 32/100
rivet-dev/agentos#2020 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
rivet-dev/agentos の issue をすべて見る
似ている issue
-
priority: low ☕️ type: bug 🐛
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
area:docs documentation good first issue priority:medium
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
calagopus/panel#285 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent-self
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
yologdev/yoyo-evolve#1117 · コメント 1 件 ·
-
[Bug]: streamed Responses API flex_unavailable error maps to 500 InternalServerError instead of 429オープンllm translation
難易度 2/5 1時間未満 初心者へのやさしさ 85/100
BerriAI/litellm#49736 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信