Skip to content

The file-write test fails when a code_files insert keeps the round's cached file rows - #1739

Merged
zlareb1 merged 1 commit into
mainfrom
fix/post-merge-1728
Nov 29, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
fix/post-merge-1728

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Related: #1728

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Not required.

Why

test_a_file_write_ends_the_no_file_row_answer is named for one behaviour: a code_files insert drops the round's cached live_files_for_path rows, so the next read of that path asks the repository. The test passed without that behaviour.

It read logo.png once before the insert. A per-path read answered from the round removes the cached rows it returns, so the entry was already gone when the insert ran and the insert's drop had nothing to drop. The second read missed whatever the insert did. The test only showed that a read of a buffered path writes the buffer first.

The test now writes before the first read, as test_a_chunk_write_ends_the_no_live_chunk_answer does. With the drop in place the read misses, writes the buffered row and calls the repository. Without it the read is answered from the prefetch with no statement and no write, and both assertions fail.

Scope and risk

One test in tests/unit/test_code_round_reads_backfill_statements.py. No server code changes: RoundReads.insert_rows already drops the cached file rows, and this test now holds it to that.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: reverting leaves nothing behind.

Tests

python -m pytest tests/unit/test_code_round_reads_backfill_statements.py -q

  • Before this change, with "code_files": self._files deleted from the table-to-cache map in RoundReads.insert_rows: 22 passed.
  • With this change and the same deletion: 1 failed (test_a_file_write_ends_the_no_file_row_answer: live_files_for_path:logo.png is not among the repository calls), 21 passed.
  • With this change and the module as it is on main: 22 passed.

ruff format --check and ruff check pass on the file.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. Checked by running the test file against the module with and without the cache drop, as listed under Tests.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py). None are affected.
  • A new migration is additive and numbered after the latest on main; no merged migration is edited. No migration.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version. No plugin file changes.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed. Not changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

🤖 Generated with Claude Code


Note

Low Risk
Single unit test change only; no production code modified.

Overview
Fixes test_a_file_write_ends_the_no_file_row_answer so it actually checks that a code_files insert invalidates RoundReads' per-path file cache and forces the next live_files_for_path to hit the repository.

The test now inserts before the first read (matching test_a_chunk_write_ends_the_no_live_chunk_answer). Previously, an eager read consumed cached prefetch rows, so the insert had nothing to drop and the assertion did not prove cache invalidation.

Assertions now require live_files_for_path:logo.png among repository calls after the buffered write, instead of comparing empty before/after snapshots.

Reviewed by Cursor Bugbot for commit 9459dad. Bugbot is set up for automated code reviews on this repo. Configure here.

…cached file rows

`test_a_file_write_ends_the_no_file_row_answer` read the path before it
wrote the row. A per-path read answered from the round removes the cached
rows it returns, so the insert had nothing left to drop, and the test passed
with `code_files` removed from the tables whose insert drops a cache.

The test now writes before the first read. With the cache dropped, the read
writes the buffered row and asks the repository; with it kept, the read is
answered from the prefetch with no statement and no write, and the test fails.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 29, 2026 1:11am UTC
loom-telemetry Ready Ready Preview Nov 29, 2026 1:11am UTC

Request Review

@zlareb1
zlareb1 merged commit a4d199f into main Nov 29, 2026
65 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant