MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / emit_init

Method emit_init

src/server/agent_server.py:156–172  ·  view source on GitHub ↗

Emit ``system/init`` — the first message the client sees on connect.

(self)

Source from the content-addressed store, hash-verified

154 # ─── init ──────────────────────────────────────────────────────────────
155
156 def emit_init(self) -> None:
157 """Emit ``system/init`` — the first message the client sees on connect."""
158 tools = _tool_schemas(self.tool_registry)
159 self._emit({
160 "type": "system",
161 "subtype": "init",
162 "session_id": self.session_id,
163 "protocol_version": PROTOCOL_VERSION,
164 "model": getattr(self.provider, "model", self.config.model),
165 "provider": self.provider_name,
166 "cwd": self.cwd,
167 "tools": tools,
168 "permission_mode": _current_mode(self.tool_context, self.config.permission_mode),
169 "apiKeySource": "config",
170 })
171 if self.init_error is not None:
172 self._emit(_system_message(self.session_id, self.init_error, level="error"))
173
174 # ─── inbound (main loop) ───────────────────────────────────────────────
175

Callers 1

spawnFunction · 0.80

Calls 4

_emitMethod · 0.95
_tool_schemasFunction · 0.85
_current_modeFunction · 0.85
_system_messageFunction · 0.85

Tested by

no test coverage detected