|
19 | 19 | from tests.control_plane.codex_checkpoint_fixture import selected_context_values |
20 | 20 |
|
21 | 21 |
|
| 22 | +def test_small_native_navigation_keeps_both_reader_routes(): |
| 23 | + from loopx.cli_commands.quota_context_reader import _native_context_reference, _native_output_bytes |
| 24 | + |
| 25 | + # Fixed reader paths isolate the caller's budget from checkout and temporary directory names. |
| 26 | + capture = {"path": f"/project/{'x' * 255}/required-context.json", "sha256": "a" * 64} |
| 27 | + view = _native_context_reference( |
| 28 | + {}, capture, mode="full", current=capture, current_document={"ok": True}, |
| 29 | + total_bytes=2000, metadata=None, progressive_enabled=True, field_index=None, |
| 30 | + initial_read_pointers=None, initial_read_reference=None, page_bytes=3200, |
| 31 | + output_bytes=3200, first_read_budget=(3200, 3200), |
| 32 | + reader_argv=["/install/bin/loopx", "--cli-bin", "/install/bin/loopx"], |
| 33 | + ) |
| 34 | + |
| 35 | + assert len(_native_output_bytes(view)) <= 3200 |
| 36 | + recovery = shlex.split(view["recovery"]["command"]) |
| 37 | + assert recovery[recovery.index("--capture-file") + 1] == capture["path"] |
| 38 | + assert recovery[recovery.index("--capture-sha256") + 1] == capture["sha256"] |
| 39 | + assert recovery[recovery.index("--max-page-output-bytes") + 1] == "3200" |
| 40 | + assert all(term in view["instruction"] for term in ("--select", "--list", "recovery.command", "context_details")) |
| 41 | + |
22 | 42 | @pytest.fixture |
23 | 43 | def decision(): |
24 | 44 | return { |
|
0 commit comments