nanobot source and test index

This index is organized by learning question, not by mechanically listing directories. Paths are relative to example/nanobot/code-EN.

Entry points and the core Turn

QuestionSource anchorTests to read firstExplanation
How does CLI start one chat request?nanobot/cli/commands.py::agenttests/cli/test_commands.pyFive entry points and runtime boundaries
How does Gateway assemble persistent services?nanobot/cli/gateway.py, nanobot/gateway/runtime.pytests/gateway/test_runtime.py, tests/cli/test_gateway_commands.pyChannels and Gateway
How does the HTTP API enter the Agent?nanobot/api/server.py::create_app, handle_chat_completionstests/test_openai_api.py, tests/test_api_stream.pyHTTP API and Python SDK
How does the Python SDK construct a runtime?nanobot/nanobot.py::Nanobot, nanobot/sdk/runtime.pytests/test_nanobot_facade.pySame as above
How does WebSocket receive and send?nanobot/channels/websocket.py::WebSocketChanneltests/channels/test_websocket_integration.pyWebSocket and WebUI
How does one Turn advance through states?nanobot/agent/loop.py::AgentLoop._process_messagetests/agent/test_loop_runner_integration.py, test_loop_save_turn.pyAgentLoop state machine
How does the model–Tool loop end?nanobot/agent/runner.py::AgentRunner.runtests/agent/test_runner_core.py, test_runner_tool_execution.pyAgentRunner’s model–Tool loop
How are the system prompt and history assembled?nanobot/agent/context.py::ContextBuildertests/agent/test_context_builder.py, test_context_prompt_cache.pyContextBuilder and model context

Messages, events, and state

QuestionSource anchorTests to read firstExplanation
Which fields belong to inbound and outbound messages?nanobot/bus/events.pytests/bus/, Channel testsMessages, Session keys, and entry points
How are messages queued?nanobot/bus/queue.py::MessageBusadjacent AgentLoop and Channel integration testsSame as above
What exact Runtime Event types exist?nanobot/bus/runtime_events.pytests/bus/test_runtime_events.pyPersistence, response, and Runtime Events
How are Sessions saved, loaded, and locked?nanobot/session/manager.py::SessionManagertests/agent/test_session_atomic.py, test_session_manager_history.pySession files and replay boundaries
How are Session keys normalized?nanobot/session/keys.pytests/agent/test_unified_session.pyMessages, Session keys, and entry points
When is history compacted?nanobot/agent/memory.py::Consolidator, nanobot/agent/autocompact.pytests/agent/test_auto_compact.py, test_consolidator.pyCompaction, Memory, and Dream
How does a persistent Goal continue?nanobot/session/goal_state.py, turn_continuation.pytests/agent/test_runner_goal_continue.py, test_loop_goal_wall_timeout.pyGoals and Continuations
How are Subagents created and cleaned up?nanobot/agent/subagent.py, agent/tools/spawn.pytests/agent/test_subagent_lifecycle.pySubagent lifecycle

Providers, Tools, and extensions

QuestionSource anchorTests to read firstExplanation
What is the unified Provider contract?nanobot/providers/base.py::LLMProvidertests/providers/Provider resolution and fallback
How is a Provider selected and instantiated?nanobot/providers/registry.py, factory.pytests/cli/test_commands.py, tests/agent/test_runtime_refresh.pySame as above
How is fallback chained?nanobot/providers/fallback_provider.pytests/agent/test_runner_fallback.pySame as above
What is the Tool contract?nanobot/agent/tools/base.py::Tooltests/tools/test_tool_validation.pyAdd a Tool
How are Tools registered, validated, and executed?nanobot/agent/tools/registry.py::ToolRegistrytests/agent/test_runner_tool_execution.pyTool registration, validation, and execution
How are external Tool plugins discovered?nanobot/agent/tools/loader.pytests/agent/test_tool_loader_entrypoints.py, test_tool_loader_scopes.pyAdd a Tool
How are Skills discovered and filtered?nanobot/agent/skills.py::SkillsLoadertests/agent/test_skills_loader.pyAdd a Skill
How does MCP connect and wrap Tools?nanobot/agent/tools/mcp.pytests/agent/test_mcp_connection.py, test_mcp_transient_retry.pyIntegrate MCP
How are Channels discovered?nanobot/channels/registry.pytests/channels/test_channel_plugins.pyAdd a Channel
How do Channels share outbound delivery?nanobot/channels/base.py, manager.pytests/channels/test_base_channel.py, test_channel_manager_delta_coalescing.pyChannels and Gateway

Automation, engineering, and security

QuestionSource anchorTests to read firstExplanation
How does Cron persist and trigger jobs?nanobot/cron/service.py, types.pytests/cron/Cron and Heartbeat
How does Heartbeat connect to Cron?heartbeat-job assembly in nanobot/cli/commands.py, nanobot/cron/service.pytests/agent/test_loop_cron_timezone.py, adjacent Cron testsSame as above
How is context protected after cancellation?nanobot/agent/runner.py::_emit_checkpoint, nanobot/agent/loop.py::_restore_runtime_checkpointtests/agent/test_task_cancel.py, test_stop_preserves_context.pyasyncio concurrency, cancellation, and cleanup
How are workspace paths restricted?nanobot/security/workspace_policy.py, workspace_access.pytests/agent/test_workspace_scope.py, tests/security/Workspace, shell, and SSRF security boundaries
How is SSRF evaluated?nanobot/security/network.pytests/security/ and web Tool testsSame as above
How is WebUI packaged into Python?pyproject.toml, webui/, build scriptspackaging and build testsPackaging, WebUI build, and cross-platform behavior

Read the test name before the test body

A test name often states the behavior maintainers intend to preserve. Read its fixtures, triggering action, and assertions before returning to the implementation; this greatly reduces guesswork based on function names.

Index boundaries

  • This page does not enumerate every Provider, Channel, or configuration field; use the official documentation for complete lists.
  • If tests are reorganized, inspect the current tests/ tree with rg --files tests.
  • “Adjacent tests” means the behavior may span multiple test layers; one file alone may not prove every boundary.

Return to Quick reference.