Keep the file name a node gave an artifact

A run_artifact row is keyed by the message the bytes left on, and that was
also the only name it could answer with — so an `@run:` reference resolved
through the row was the same bytes under a name its producer never chose.
The row now records the file name beside the message name; rows written
before the column answer as they always did.

The fallback also checks the bytes are still in the store, which the bare
digest spelling beside it has always done. A missing blob now fails at
submit rather than in the middle of the run that wanted it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-26 22:45:11 +02:00
co-authored by Claude Opus 5
parent 001ec7b282
commit 2e82367926
4 changed files with 81 additions and 8 deletions
+4
View File
@@ -445,7 +445,11 @@ class RunArtifact(SQLModel, table=True):
__tablename__ = "run_artifact"
run_id: str = Field(primary_key=True, max_length=64)
#: The message the bytes left the node on, which is what addresses them.
name: str = Field(primary_key=True, max_length=255)
#: What the node called the file, when it said. Kept because a reference
#: rebuilt from this row is otherwise the same bytes under another name.
filename: str | None = Field(default=None, max_length=255)
node: str = Field(default="", max_length=255)
digest: str = Field(default="", index=True, max_length=71)
size: int = 0