refactor(llm-retry, session): offload images by surface replacement instead of a watermark event

Drop the image/offload event and every session change with it. An adapter's
IMAGE_OFFLOAD_REQUIRED failure now makes dsh-llm-retry replace the surface
nodes carrying the named oldest images with copies whose blocks are marked
offloaded, through the same surfaceOp: replace compaction uses, then retry the
step. ImageBlock.offloaded becomes a durable field the routes project and the
token meter prices; the session core, its event map, derivation, and
validation return to master.
This commit is contained in:
creatixchu committed 2026-09-08 12:00:35 +08:00
1 parent 52386ec6fb
commit 6329c53a37
57 files changed
+395 -958

No files matched your search

-15
View File
@@ -43,17 +43,6 @@ for line in sys.stdin:
print(json.dumps({"jsonrpc": "2.0", "method": "session.event", "params": {"sessionId": params["sessionId"], "event": {"type": "agent/inbox/spliced", "data": {"target": "next-turn", "start": 0, "inserted": [{"id": "message-1"}]}}}}), flush=True)
print(json.dumps({"jsonrpc": "2.0", "method": "session.status", "params": {"sessionId": params["sessionId"], "status": "running"}}), flush=True)
print(json.dumps({"jsonrpc": "2.0", "id": msg["id"], "result": {"messageId": "message-1"}}), flush=True)
print(json.dumps({
"jsonrpc": "2.0",
"method": "session.event",
"params": {
"sessionId": params["sessionId"],
"event": {
"type": "image/offload",
"data": {"turn": 1, "step": 1, "watermark": {"seq": 7, "path": [3]}},
},
},
}), flush=True)
print(json.dumps({
"jsonrpc": "2.0",
"method": "session.event",
@@ -120,10 +109,6 @@ for line in sys.stdin:
assert result.final_response == "hello from runtime"
assert result.finish_reason == "max-tokens"
assert result.events[1] == {
"type": "image/offload",
"data": {"turn": 1, "step": 1, "watermark": {"seq": 7, "path": [3]}},
}
assert result.events[-1]["type"] == "turn/end"
dumped_env = json.loads(env_dump.read_text())
assert dumped_env["DEEPSEEK_API_KEY"] == "env-key"