← Về thư mục
openai4s/agent/loop.py
- _LedgerTranscriptEventSink · class · L192-L201 — class _LedgerTranscriptEventSink
- init · method · L195-L197 — def init(self, ledger: RuntimeActionLedger, transcript: Any) -> None
- emit · method · L199-L201 — def emit(self, event: Any) -> None
- _FrameUsageEventSink · class · L204-L219 — class _FrameUsageEventSink
- init · method · L212-L214 — def init(self, inner: Any, record: Callable[[Mapping[str, Any]], None])
- emit · method · L216-L219 — def emit(self, event: Any) -> None
- _frame_status_for_stop_reason · function · L222-L234 — def _frame_status_for_stop_reason(stop_reason: object) -> str
- _completion_summary · function · L237-L248 — def _completion_summary(completion: Any) -> str | None
- allowed_test_command_error · function · L257-L286 — def allowed_test_command_error(command: str) -> str | None
- _preauthorized_test_commands_note · function · L289-L300 — def _preauthorized_test_commands_note(commands: Sequence[str]) -> str
- Agent · class · L304-L1479 — class Agent
- post_init · method · L377-L447 — def post_init(self) -> None
- _log · method · L449-L451 — def _log(self, *a: object) -> None
- _python_read_isolation · method · L453-L493 — def _python_read_isolation(self) -> KernelReadIsolation | None
- _system_prompt · method · L495-L516 — def _system_prompt(self) -> str
- _pre_exec_gate · method · L518-L555 — def _pre_exec_gate(self, code: str, messages: list[dict]) -> str | None
- _admit_cell · method · L557-L599 — def _admit_cell(self, _action: object) -> None
- _admit_spawned_cell_kernel · method · L601-L621 — def _admit_spawned_cell_kernel(self, kernel: object) -> None
- _install_cell_recorder · method · L623-L644 — def _install_cell_recorder(self) -> None
- _explicit_evidence_mode · method · L646-L657 — def _explicit_evidence_mode(self) -> str | None
- authorize_test_commands · method · L659-L697 — def authorize_test_commands(self) -> list[str]
- code_mode_preflight_refusal · method · L699-L748 — def code_mode_preflight_refusal(self) -> str | None
- run · method · L750-L770 — def run(self, task: str) -> dict
- close_unrun_frame · method · L772-L782 — def close_unrun_frame(self, status: str = "failed") -> None
- _persist_frame_status · method · L784-L791 — def _persist_frame_status(self, status: str) -> None
- _record_frame_usage · method · L793-L812 — def _record_frame_usage(self, usage: Mapping[str, Any]) -> None
- _run_task · method · L814-L1032 — def _run_task(self, task: str) -> dict
- make_python_kernel · function · L864-L876 — def make_python_kernel() -> Kernel: #
self.env is read at spawn time, not captured, so a pending # host.env.use() switch retargets both the foreground worker and # any later background worker.
- publish_foreground · function · L880-L882 — def publish_foreground(kernel: object | None) -> None
- bootstrap · function · L884-L892 — def bootstrap(kernel: Any) -> None: # The worker exists, so its actual sandbox posture is now # measurable. Refuse before any executable Skill sidecar bootstrap.
- _account_abandoned_reply · function · L930-L947 — def _account_abandoned_reply(reply: Mapping[str, Any]) -> None
- _model_tool_specs · method · L1034-L1061 — def _model_tool_specs( self, tool_catalog: Any, messages: Sequence[Mapping[str, Any]] ) -> tuple[Any, ...]
- _tool_offered · method · L1063-L1095 — def _tool_offered( self, tool: Any, *, _reachable: dict[str, bool] | None = None ) -> bool
- _session_is_metered · method · L1097-L1119 — def _session_is_metered(self) -> bool
- _provider_call_scope · method · L1121-L1159 — def _provider_call_scope(self) -> str | None
- _action_ledger · method · L1161-L1187 — def _action_ledger( self, tool_catalog: Any, task: str ) -> RuntimeActionLedger | None
- _queue_env_switch · method · L1189-L1218 — def _queue_env_switch(self, name: str) -> None
- _apply_pending_env · method · L1220-L1260 — def _apply_pending_env(self, lazy_kernel: Any) -> None
- _execute_r · method · L1262-L1322 — def _execute_r(self, code: str, *, cell_id: str | None = None) -> dict
- _shutdown_r_kernel · method · L1324-L1333 — def _shutdown_r_kernel(self) -> None
- current_kernel_generation_id · method · L1335-L1345 — def current_kernel_generation_id(self, language: str = "python") -> str | None
- interrupt_foreground · method · L1347-L1373 — def interrupt_foreground(self) -> bool
- _cancelled · method · L1375-L1381 — def _cancelled(self) -> bool
- _finish · method · L1383-L1401 — def _finish( self, transcript: list[Turn], final_reply: str | None, reason: str, *, completion: Any = None, turns: int = 0, ) -> dict
- _close_run · method · L1403-L1445 — def _close_run(self) -> None
- _ensure_delegation_runner · method · L1447-L1479 — def _ensure_delegation_runner(self) -> None
- _extract_code · function · L1482-L1496 — def _extract_code(text: str) -> str | None
- run_task · function · L1499-L1500 — def run_task(task: str, *, verbose: bool = False, cfg: Config | None = None) -> dict
- enable_auto_run_environment · function · L1514-L1534 — def enable_auto_run_environment( environ: dict[str, str] | None = None, ) -> dict[str, str]
- _cli_run_evidence · function · L1537-L1592 — def _cli_run_evidence( store: Any, root_frame_id: str ) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]
- review_cli_result · function · L1595-L1711 — def review_cli_result( task: str, result: Mapping[str, Any], *, cfg: Config, store: Any = None, root_frame_id: str | None = None, chat_call: Any = None, ) -> dict[str, Any]