tinycodinglm / agentic /agent-0009-stable-manifest-order.jsonl
winapiadmin's picture
Upload folder using huggingface_hub
1f3a244 verified
|
Raw History Blame Contribute Delete
4.55 kB
opencode trace
System You are a coding agent with access to a bash tool and a file-editing tool in the user's project directory. Use them to investigate and fix issues, verifying your fix before reporting back.

You are a coding agent with access to a bash tool and a file-editing tool in the user's project directory. Use them to investigate and fix issues, verifying your fix before reporting back.

User

write_manifest() output order changes from run to run and test_manifest.py::test_stable_order fails intermittently. Make it deterministic.

Assistant
2 tool calls (bash)
Assistant

The bug is os.listdir: its order is filesystem-dependent and explicitly arbitrary, so consecutive calls (or different machines) can return different orders. The test already states the contract — output must equal its own sorted form — so the fix is sorted(...) at the source, not sorting at each call site.

Assistant
2 tool calls (edit_file, bash)
Assistant

Green across two consecutive runs. The fix is sorted(...) at the source: os.listdir order is filesystem-dependent and explicitly arbitrary, so pinning the contract (output equals its own sorted form) inside write_manifest removes the flakiness for every caller, with no other behavior change.