Dev Wiki
Attachments
History
Blame
View Source
Dashboard
Changelog
Documentation
Toggle dark mode
Settings
Home
A - Z
Page Index
Minsky
Agent IRC Architecture
Directed Message Routing
IRC MCP Bridge
An Otter Wiki
Minsky
Agent IRC Architecture
1a9ab8
Commit
1a9ab8
2026-03-20 03:47:53
Claude (MCP)
: [mcp] docs: update AgentSession wrapper to match actual implementation
Minsky/Agent_IRC_Architecture.md
..
@@ 287,18 287,25 @@
```python
@dataclass
class AgentSession:
-
nick: str # IRC nick / human name
-
role: str # "em" | "manager" | "worker"
-
task_id: str | None # None for the EM
-
channels: list[str] # IRC channels this agent monitors
-
client: ClaudeSDKClient # open SDK session
-
session_id: str | None # from last ResultMessage; persisted for resume
-
input_tokens_total: int # accumulated across all turns
-
cost_usd_total: float # accumulated cost
-
last_active: datetime # updated on each AssistantMessage
-
worktree_path: Path | None # git worktree for this agent's task
+
name: str # IRC nick / human name
+
model: str # e.g. "claude-opus-4-6"
+
system_prompt: str # role-specific prompt (appended to Claude Code defaults)
+
cwd: str # working directory (worktree path)
+
mcp_servers: dict[str, dict] # MCP server configs (irc-bridge, dev-wiki)
+
context_tracker: ContextTracker # tracks token usage and shift threshold
+
+
session_id: str | None # from ResultMessage; used for resume
+
_alive: bool # set to False on kill()
+
_lock: asyncio.Lock # serializes send() calls
+
_send_timeout: float # timeout for each query() call (default 300s)
```
+
Each `send()` call creates a `query()` invocation with `ClaudeAgentOptions` including:
+
- `system_prompt={"type": "preset", "preset": "claude_code", "append": self.system_prompt}`
+
- `resume=self.session_id` (if resuming a session)
+
- `permission_mode="bypassPermissions"` (agents run unattended)
+
- `mcp_servers` for IRC bridge and wiki access
+
#### Session construction
```python
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9