← Về thư mục
tests/test_agent.py
- ScriptedLLM · class · L18-L38 — class ScriptedLLM
- init · method · L21-L23 — def init(self, replies)
- call · method · L25-L38 — def call(self, messages, cfg, **kw)
- _tool_block · function · L41-L44 — def _tool_block(json_body: str) -> str
- test_detached_call_budget_is_keyed_on_the_session_root · function · L47-L83 — def test_detached_call_budget_is_keyed_on_the_session_root(monkeypatch)
- _Frames · class · L59-L66 — class _Frames
- init · method · L60-L61 — def init(self)
- resolve_frame_scope · method · L63-L66 — def resolve_frame_scope(self, frame_id, **_kwargs)
- test_code_as_action_cycle · function · L86-L101 — def test_code_as_action_cycle(monkeypatch)
- test_cli_save_artifact_resolves_relative_to_actual_kernel_cwd · function · L104-L132 — def test_cli_save_artifact_resolves_relative_to_actual_kernel_cwd( monkeypatch, tmp_path )
- test_no_code_block_nudge · function · L135-L144 — def test_no_code_block_nudge(monkeypatch)
- test_cli_non_scientific_finalize_uses_live_catalog_and_engine_result · function · L147-L204 — def test_cli_non_scientific_finalize_uses_live_catalog_and_engine_result(monkeypatch)
- finalize_chat · function · L154-L175 — def finalize_chat(messages, cfg, **kwargs)
- unexpected_kernel · function · L179-L180 — def unexpected_kernel(_args, *_kwargs)
- test_stage1_missing_profile_keeps_cli_control_plane_kernel_lazy · function · L208-L279 — def test_stage1_missing_profile_keeps_cli_control_plane_kernel_lazy( tmp_path, monkeypatch, run_tool_first )
- control_chat · function · L226-L247 — def control_chat(messages, cfg, **kwargs)
- forbidden_readiness · function · L249-L250 — def forbidden_readiness(**_kwargs)
- forbidden_kernel · function · L252-L253 — def forbidden_kernel(_args, *_kwargs)
- test_stage1_cli_cell_readiness_refuses_before_safety_or_worker · function · L283-L332 — def test_stage1_cli_cell_readiness_refuses_before_safety_or_worker( tmp_path, monkeypatch, language, fence )
- forbidden_kernel · function · L300-L301 — def forbidden_kernel(_args, *_kwargs)
- test_submit_output_soft_fail_does_not_complete · function · L335-L363 — def test_submit_output_soft_fail_does_not_complete(monkeypatch)
- _MeteredLLM · class · L366-L391 — class _MeteredLLM(ScriptedLLM)
- init · method · L369-L374 — def init(self, replies, *, raise_on_call=None, after_call=None)
- call · method · L376-L391 — def call(self, messages, cfg, **kw)
- _SettableCancellation · class · L394-L399 — class _SettableCancellation
- init · method · L395-L396 — def init(self, cancelled: bool = False) -> None
- cancelled · method · L398-L399 — def cancelled(self) -> bool
- _root_frame_row · function · L402-L405 — def _root_frame_row(agent)
- test_cli_root_frame_is_done_with_token_totals_after_submit · function · L408-L428 — def test_cli_root_frame_is_done_with_token_totals_after_submit(monkeypatch)
- test_cli_root_frame_is_failed_after_max_turns · function · L431-L442 — def test_cli_root_frame_is_failed_after_max_turns(monkeypatch)
- test_cli_root_frame_is_cancelled_when_cancelled_before_the_run · function · L445-L460 — def test_cli_root_frame_is_cancelled_when_cancelled_before_the_run(monkeypatch)
- test_cli_root_frame_is_cancelled_when_the_engine_stops_on_cancel · function · L463-L490 — def test_cli_root_frame_is_cancelled_when_the_engine_stops_on_cancel(monkeypatch)
- test_cli_root_frame_is_failed_when_the_run_raises · function · L493-L501 — def test_cli_root_frame_is_failed_when_the_run_raises(monkeypatch)
- test_cli_root_frame_is_cancelled_on_ctrl_c · function · L504-L516 — def test_cli_root_frame_is_cancelled_on_ctrl_c(monkeypatch)
- interrupted · function · L507-L508 — def interrupted(self, messages, **_kwargs)
- test_reused_cli_agent_reopens_its_frame_for_the_next_run · function · L519-L536 — def test_reused_cli_agent_reopens_its_frame_for_the_next_run(monkeypatch)
- test_agent_given_a_frame_does_not_write_that_frame_s_status · function · L539-L558 — def test_agent_given_a_frame_does_not_write_that_frame_s_status(monkeypatch)
- test_max_turns_stop · function · L561-L567 — def test_max_turns_stop(monkeypatch): # never calls submit_output -> should stop at max_turns
- test_repeated_native_tool_trips_no_progress · function · L570-L618 — def test_repeated_native_tool_trips_no_progress(monkeypatch, tmp_path)
- chat · function · L575-L597 — def chat(messages, cfg, **kwargs)
- _FakeRKernel · class · L624-L646 — class _FakeRKernel
- init · method · L627-L629 — def init(self)
- is_alive · method · L631-L632 — def is_alive(self)
- execute · method · L634-L643 — def execute(self, code, origin="agent", on_chunk=None)
- shutdown · method · L645-L646 — def shutdown(self)
- test_r_cell_routes_to_r_kernel_and_is_non_terminal · function · L649-L678 — def test_r_cell_routes_to_r_kernel_and_is_non_terminal(monkeypatch)
- fake_spawn · function · L659-L661 — def fake_spawn(**kw)
- test_r_cell_without_r_soft_fails_into_observation · function · L681-L701 — def test_r_cell_without_r_soft_fails_into_observation(monkeypatch)
- no_r · function · L686-L687 — def no_r(**kw)
- test_react_tool_call_then_submit · function · L707-L735 — def test_react_tool_call_then_submit(monkeypatch, tmp_path)
- test_react_malformed_tool_block_surfaces_error · function · L738-L757 — def test_react_malformed_tool_block_surfaces_error(monkeypatch)
- test_code_cell_wins_over_embedded_tool_fence · function · L760-L786 — def test_code_cell_wins_over_embedded_tool_fence(monkeypatch)
- test_four_backtick_python_fence_is_complete_and_wins_over_inner_tool · function · L789-L802 — def test_four_backtick_python_fence_is_complete_and_wins_over_inner_tool()
- test_estimate_tokens_monotonic · function · L808-L811 — def test_estimate_tokens_monotonic()
- test_context_estimate_accounts_for_structured_components_independently · function · L814-L836 — def test_context_estimate_accounts_for_structured_components_independently()
- test_context_estimate_separates_tool_results_and_artifact_refs · function · L839-L851 — def test_context_estimate_separates_tool_results_and_artifact_refs()
- test_large_tool_result_is_content_addressed_and_recoverable · function · L854-L882 — def test_large_tool_result_is_content_addressed_and_recoverable(tmp_path)
- test_large_tool_result_can_become_a_versioned_artifact_reference · function · L885-L900 — def test_large_tool_result_can_become_a_versioned_artifact_reference()
- archive · function · L888-L890 — def archive(content, message, metadata)
- test_code_and_observation_are_one_atomic_compaction_segment · function · L903-L919 — def test_code_and_observation_are_one_atomic_compaction_segment()
- test_should_compact_uses_window · function · L922-L931 — def test_should_compact_uses_window(monkeypatch)
- test_compact_shrinks_and_preserves_head · function · L934-L946 — def test_compact_shrinks_and_preserves_head(monkeypatch)
- test_compact_handoff_is_structured_and_never_invents_kernel_continuity · function · L949-L990 — def test_compact_handoff_is_structured_and_never_invents_kernel_continuity( monkeypatch, tmp_path )
- test_compact_handoff_marks_restarted_generation_as_non_persistent · function · L993-L1015 — def test_compact_handoff_marks_restarted_generation_as_non_persistent(monkeypatch)
- test_reused_agent_recreates_its_delegation_runner · function · L1029-L1107 — def test_reused_agent_recreates_its_delegation_runner(monkeypatch, second_spec)
- fake_run_one · function · L1037-L1046 — def fake_run_one(self, child)
- finalize_reply · function · L1050-L1073 — def finalize_reply(call_index)
- chat_with_second_run_delegation · function · L1075-L1088 — def chat_with_second_run_delegation(messages, cfg, **kwargs)
- test_delegate_fanout_cap · function · L1110-L1113 — def test_delegate_fanout_cap()
- test_delegate_single_and_list · function · L1116-L1137 — def test_delegate_single_and_list(monkeypatch): # Stub the leaf Agent.run so no real LLM/kernel is used.
- fake_run · function · L1118-L1126 — def fake_run(self, task)
- test_delegate_output_schema_uses_shared_completion_validation · function · L1140-L1165 — def test_delegate_output_schema_uses_shared_completion_validation(monkeypatch)
- fake_run · function · L1141-L1150 — def fake_run(self, task)
- test_web_delegated_child_runs_in_parent_session_workspace · function · L1168-L1199 — def test_web_delegated_child_runs_in_parent_session_workspace(monkeypatch, tmp_path)
- test_cli_delegated_child_keeps_process_cwd · function · L1202-L1225 — def test_cli_delegated_child_keeps_process_cwd(monkeypatch, tmp_path)
- test_delegating_agent_threads_workspace_to_its_nested_runner · function · L1228-L1236 — def test_delegating_agent_threads_workspace_to_its_nested_runner(tmp_path)
- test_delegate_session_cap · function · L1239-L1248 — def test_delegate_session_cap(monkeypatch)
- fake_run · function · L1240-L1241 — def fake_run(self, task)