← Về thư mục
tests/test_agent_runtime.py
- _native_call · function · L26-L45 — def _native_call( index: int, *, name: str = "lookup", wire_id: str | None | object = ..., arguments: dict | None = None, parse_error: str | None = None, ) -> NativeToolCall
- FakeDispatcher · class · L48-L55 — class FakeDispatcher
- init · method · L49-L51 — def init(self, last_output=None)
- call · method · L53-L55 — def call(self, method, args)
- FakeKernel · class · L58-L73 — class FakeKernel
- init · method · L59-L67 — def init(self, result=None, after_execute=None)
- execute · method · L69-L73 — def execute(self, code, origin=None)
- _executor · function · L76-L82 — def _executor(*, kernel=None, dispatcher=None, gate=None, execute_r=None)
- test_chat_model_passes_native_schemas_and_is_blocking_by_default · function · L85-L104 — def test_chat_model_passes_native_schemas_and_is_blocking_by_default()
- fake_chat · function · L94-L96 — def fake_chat(messages, received_cfg, **kwargs)
- test_chat_model_refreshes_callable_session_catalog_each_turn · function · L107-L123 — def test_chat_model_refreshes_callable_session_catalog_each_turn()
- fake_chat · function · L113-L116 — def fake_chat(messages, cfg, **kwargs)
- test_chat_model_cancel_releases_owner_and_quarantines_late_provider_output · function · L126-L180 — def test_chat_model_cancel_releases_owner_and_quarantines_late_provider_output()
- fake_chat · function · L137-L147 — def fake_chat(messages, cfg, **kwargs)
- account · function · L149-L151 — def account(reply)
- test_a_call_cancelled_before_it_starts_never_reaches_the_provider · function · L183-L223 — def test_a_call_cancelled_before_it_starts_never_reaches_the_provider()
- cancelled_after_spawn · function · L197-L201 — def cancelled_after_spawn() -> bool: # False only for the pre-spawn check; true from the moment the thread # could be running, whichever side of the handoff asks first.
- fake_chat · function · L203-L206 — def fake_chat(messages, cfg, **kwargs)
- test_chat_model_projects_stream_deltas_on_the_owning_thread · function · L226-L256 — def test_chat_model_projects_stream_deltas_on_the_owning_thread()
- fake_chat · function · L232-L237 — def fake_chat(messages, cfg, **kwargs)
- collect_delta · function · L247-L249 — def collect_delta(text)
- test_chat_model_bounds_detached_provider_calls · function · L259-L300 — def test_chat_model_bounds_detached_provider_calls(monkeypatch)
- blocked_chat · function · L269-L273 — def blocked_chat(messages, cfg, **kwargs)
- test_chat_model_budget_never_charges_a_live_provider_call · function · L303-L329 — def test_chat_model_budget_never_charges_a_live_provider_call()
- test_one_session_cannot_stack_cancelled_calls_against_a_stale_ledger · function · L332-L397 — def test_one_session_cannot_stack_cancelled_calls_against_a_stale_ledger( monkeypatch, )
- blocked_chat · function · L352-L356 — def blocked_chat(messages, cfg, **kwargs)
- stop_one · function · L358-L371 — def stop_one(scope)
- test_native_batch_returns_one_canonical_tool_message_per_call · function · L400-L442 — def test_native_batch_returns_one_canonical_tool_message_per_call(monkeypatch)
- fake_execute · function · L403-L405 — def fake_execute(dispatcher, call)
- test_writing_native_call_uses_delegated_capture_hooks · function · L445-L482 — def test_writing_native_call_uses_delegated_capture_hooks(monkeypatch)
- Hooks · class · L448-L454 — class Hooks
- before_native · method · L449-L451 — def before_native(self, call)
- after_native · method · L453-L454 — def after_native(self, call, token, result)
- test_native_parse_error_never_dispatches · function · L485-L508 — def test_native_parse_error_never_dispatches(monkeypatch)
- unexpected_dispatch · function · L486-L487 — def unexpected_dispatch(*args)
- test_native_limit_skips_dispatch_but_never_drops_tool_results · function · L511-L532 — def test_native_limit_skips_dispatch_but_never_drops_tool_results(monkeypatch)
- fake_execute · function · L514-L516 — def fake_execute(dispatcher, call)
- test_code_observation_notes_extra_cells_and_only_submit_sets_completion · function · L535-L576 — def test_code_observation_notes_extra_cells_and_only_submit_sets_completion()
- test_cli_revalidates_mid_cell_completion_after_capture_hooks · function · L579-L607 — def test_cli_revalidates_mid_cell_completion_after_capture_hooks()
- RevalidatingDispatcher · class · L580-L590 — class RevalidatingDispatcher(FakeDispatcher)
- init · method · L581-L583 — def init(self)
- revalidate_pending_completion · method · L585-L590 — def revalidate_pending_completion(self)
- test_code_observation_notes_an_incomplete_tail_after_the_executed_cell · function · L610-L622 — def test_code_observation_notes_an_incomplete_tail_after_the_executed_cell()
- test_none_action_keeps_legacy_tool_fallback_as_user_history · function · L625-L651 — def test_none_action_keeps_legacy_tool_fallback_as_user_history(monkeypatch)
- fake_run · function · L628-L633 — def fake_run(dispatcher, parsed_calls, errors, *, on_result=None)
- test_none_action_can_fall_back_to_code_when_native_tools_are_unavailable · function · L654-L667 — def test_none_action_can_fall_back_to_code_when_native_tools_are_unavailable()
- test_incomplete_cell_is_not_executed_and_requests_a_full_replacement · function · L670-L682 — def test_incomplete_cell_is_not_executed_and_requests_a_full_replacement()
- test_compaction_expands_tail_to_keep_assistant_tool_group_atomic · function · L685-L738 — def test_compaction_expands_tail_to_keep_assistant_tool_group_atomic(monkeypatch)
- fake_compact · function · L705-L722 — def fake_compact( messages, cfg, , keep_recent, archive_dir, archive_metadata, large_output_chars, *_kwargs, )
- test_compaction_circuit_breaker_stops_repeated_low_yield_calls · function · L741-L772 — def test_compaction_circuit_breaker_stops_repeated_low_yield_calls(monkeypatch)
- no_yield · function · L751-L753 — def no_yield(messages, cfg, **kwargs)
- test_executor_records_kernel_generation_change_for_safe_handoff · function · L775-L791 — def test_executor_records_kernel_generation_change_for_safe_handoff()
- test_transcript_sink_projects_only_reply_and_observed_outcome_events · function · L794-L809 — def test_transcript_sink_projects_only_reply_and_observed_outcome_events()
- test_format_observation_preserves_stable_error_and_usage_protocol · function · L812-L833 — def test_format_observation_preserves_stable_error_and_usage_protocol()
- test_format_observation_reminds_models_that_host_is_injected · function · L836-L841 — def test_format_observation_reminds_models_that_host_is_injected()
- test_a_reply_delivered_before_cancellation_keeps_its_usage · function · L844-L894 — def test_a_reply_delivered_before_cancellation_keeps_its_usage(monkeypatch)
- StopRightAfterDelivery · class · L867-L871 — class StopRightAfterDelivery
- complete · method · L868-L871 — def complete(self, messages, on_delta)
- Events · class · L875-L878 — class Events
- emit · method · L876-L878 — def emit(self, event)
- Executor · class · L880-L882 — class Executor
- execute · method · L881-L882 — def execute(self, action, reply, state)
- test_agent_composes_chat_model_without_a_second_cancellation_wrapper · function · L897-L921 — def test_agent_composes_chat_model_without_a_second_cancellation_wrapper()
- test_delegated_children_are_bounded_by_the_process_ceiling_only · function · L924-L942 — def test_delegated_children_are_bounded_by_the_process_ceiling_only()
- test_late_accounting_survives_a_sink_that_raises_a_base_exception · function · L945-L964 — def test_late_accounting_survives_a_sink_that_raises_a_base_exception()
- exploding · function · L951-L954 — def exploding(reply)
- recording · function · L956-L958 — def recording(reply)
- test_call_context_is_captured_on_the_owning_thread_before_the_handoff · function · L967-L999 — def test_call_context_is_captured_on_the_owning_thread_before_the_handoff()
- fake_chat · function · L980-L985 — def fake_chat(messages, cfg, **kwargs)
- test_call_context_is_absent_when_no_provider_asked_for_one · function · L1002-L1014 — def test_call_context_is_absent_when_no_provider_asked_for_one()
- fake_chat · function · L1005-L1008 — def fake_chat(messages, cfg, **kwargs)
- test_the_cancel_probe_carries_the_mid_stream_policy · function · L1017-L1031 — def test_the_cancel_probe_carries_the_mid_stream_policy()
- fake_chat · function · L1021-L1024 — def fake_chat(messages, cfg, **kwargs)
- test_a_delegated_child_of_a_metered_session_drains_too · function · L1034-L1050 — def test_a_delegated_child_of_a_metered_session_drains_too()
- _GenerationAttemptStore · class · L1064-L1087 — class _GenerationAttemptStore
- init · method · L1065-L1068 — def init(self) -> None
- allocate_execution_attempt · method · L1070-L1072 — def allocate_execution_attempt(self, *, group_id, producing_cell_id)
- mark_execution_attempt_started · method · L1074-L1075 — def mark_execution_attempt_started(self, attempt_id)
- mark_execution_attempt_response · method · L1077-L1078 — def mark_execution_attempt_response(self, attempt_id)
- mark_execution_attempt_capture · method · L1080-L1081 — def mark_execution_attempt_capture(self, attempt_id)
- bind_execution_attempt_generation · method · L1083-L1084 — def bind_execution_attempt_generation(self, attempt_id, generation_id)
- finish_execution_attempt · method · L1086-L1087 — def finish_execution_attempt(self, attempt_id, *, terminal_state)
- _Recorder · class · L1090-L1100 — class _Recorder
- init · method · L1093-L1094 — def init(self, open_rows: dict[str, str]) -> None
- observe · method · L1096-L1097 — def observe(self, kernel, *, language="python")
- current · method · L1099-L1100 — def current(self, language="python")
- _generation_executor · function · L1103-L1113 — def _generation_executor(execute_r, recorder, kernel=None)
- _run_r · function · L1116-L1121 — def _run_r(executor, state=None)
- test_cli_r_cell_attempt_binds_the_r_kernel_generation · function · L1124-L1133 — def test_cli_r_cell_attempt_binds_the_r_kernel_generation()
- test_cli_r_cell_error_result_from_the_kernel_still_names_its_generation · function · L1136-L1149 — def test_cli_r_cell_error_result_from_the_kernel_still_names_its_generation()
- test_cli_r_soft_error_never_binds_a_stale_generation · function · L1161-L1171 — def test_cli_r_soft_error_never_binds_a_stale_generation(synthesized)
- test_cli_r_and_python_attempts_name_their_own_generations · function · L1174-L1195 — def test_cli_r_and_python_attempts_name_their_own_generations()
- GenerationKernel · class · L1175-L1179 — class GenerationKernel(FakeKernel)
- execute · method · L1178-L1179 — def execute(self, code, origin=None, cell_id=None)
- test_cli_r_attempt_without_a_recorder_binds_nothing · function · L1198-L1206 — def test_cli_r_attempt_without_a_recorder_binds_nothing()
- _real_r_available · function · L1209-L1212 — def _real_r_available() -> bool
- test_cli_run_r_cell_attempt_names_the_durable_r_generation · function · L1218-L1254 — def test_cli_run_r_cell_attempt_names_the_durable_r_generation(monkeypatch, tmp_path)
- chat · function · L1231-L1233 — def chat(messages, cfg, **kwargs)