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

Method on_message

src/server/agent_server.py:1185–1194  ·  view source on GitHub ↗
(message: Any)

Source from the content-addressed store, hash-verified

1183 })
1184
1185 def on_message(message: Any) -> None:
1186 # Persist into the session conversation so the next turn pairs
1187 # tool_use ↔ tool_result, then ship the SDK envelope to the client.
1188 try:
1189 self.session.conversation.add_message(message.role, message.content)
1190 except Exception: # noqa: BLE001
1191 logger.exception("[agent-server] persist failed")
1192 env = _sdk_envelope(message, self.session_id)
1193 if env is not None:
1194 self._emit(env)
1195
1196 # /effort: wrap the provider to inject reasoning_effort (default off ⇒
1197 # the real provider is used unchanged).

Callers 1

run_agentFunction · 0.80

Calls 3

_emitMethod · 0.95
_sdk_envelopeFunction · 0.85
add_messageMethod · 0.80

Tested by

no test coverage detected