Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/architecture/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ The `egg_agent` client (`shared/egg_agent/client.py`) emits structured log event
| `tool_use` | Agent invokes a tool | `tool_name`, `tool_use_id`, `input` |
| `tool_result` | Tool returns a result | `tool_use_id`, `is_error`, `content` |
| `assistant` | Agent emits a text block | `event_subtype: "text"`, `text` |
| `system` | Broad category for SDK/lifecycle events. Subtypes include `init`, `result`, `mcp_tools_enabled`/`mcp_tools_error`/`mcp_nudge_skipped`, `route_guidance_enabled`/`route_guidance_skipped`, `output_cap_deny`, `midturn_message_injection`, and the session-resume pair (#3200 slice-6): `session_resume` (resuming prior session) or `session_resume_skipped` (resume requested but `EGG_SESSION_RESUME` is off) | `event_subtype`; the resume subtypes also carry `session_id` |

Tool input, output, and assistant text content is truncated to 2000 characters in log events to avoid log bloat; a `... (N chars)` suffix is appended when truncation occurs.

Expand Down
3 changes: 3 additions & 0 deletions docs/development/STRUCTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,15 @@ shared/
├── egg_agent/ # Claude Agent SDK wrapper
│ ├── __init__.py # Public API: AgentResult, build_agent_command
│ ├── __main__.py # CLI entry point (python3 -m egg_agent)
│ ├── _logging.py # Logger resolution: returns egg_logging structured logger or a kwarg-dropping stdlib fallback when egg_logging is absent (shared by client.py and session.py)
│ ├── client.py # run_agent(), run_agent_async()
│ ├── command.py # build_agent_command() for orchestrator-spawned containers
│ ├── result.py # AgentResult dataclass
│ ├── session.py # Session-state round-trip for BRC warm resume (#3200 slice-6): write_session_state(), read_session_state(), session_resume_enabled(); gated on EGG_SESSION_RESUME (default OFF); path via EGG_SESSION_STATE_FILE or --session-state-file
│ ├── tool_interceptor.py # Pre-execution file write checks (Write/Edit/NotebookEdit) against role restrictions
│ ├── tool_output_cap.py # Predictive PreToolUse cap for built-in CC tools (Read/Grep): denies calls whose model-bound result is likely to be excessive (cost/context discipline, NOT the buffer-crash fix — that's the raised reader buffer in client.py, #2884); tunable via EGG_TOOL_OUTPUT_CAP / EGG_READ_CAP_BYTES (#2876); agents can raise their own session's Read cap by writing the byte size to /tmp/egg-read-cap-bytes (#3175)
│ ├── midturn_messages.py # Throttled PostToolUse hook that polls the message bus mid-turn and injects new operator-authored messages as additionalContext; backed by EGG_MIDTURN_MESSAGES_INTERVAL_SECS (default 60 s) and EGG_MIDTURN_MESSAGES=false escape hatch (#3123)
│ ├── queryable_env.py # JIT-pull "queryable environment" renderers for the BRC event-pump (#3200 slice-5): small stable POINTERS (git log recipe, BRC-memory path) in the protected root instead of inlining the bulk, to slow recency-driven context growth before auto-compaction
│ └── route_guidance.py # Advisory system-prompt addendum appended only on LiteLLM (non-Claude) routes: steers toward batched tool calls, filtered output, and subagent-isolated bulk reads to cut turns × context cost; gated on ANTHROPIC_CUSTOM_MODEL_OPTION, kill switch EGG_ROUTE_PROMPT_GUIDANCE=false (#3175)
├── egg_anchor/ # Agent anchor mechanism for post-compaction state recovery
│ ├── __init__.py # Public API exports
Expand Down
Loading