1 KiB
1 KiB
04-01 Summary
Outcome
Replaced the Matrix real backend's custom AgentSessionClient path with a shared
AgentApiWrapper over upstream lambda_agent_api.AgentApi.
Changes
- Added
sdk/agent_api_wrapper.pyto captureMsgEventEnd.tokens_usedwithout modifyingexternal/. - Rewrote
sdk/real.pyto use a sharedagent_api, stream text chunks fromAgentApi.send_message(), and emit a finalMessageChunkwithlast_tokens_used. - Updated
adapter/matrix/bot.pyto constructRealPlatformClientwithAgentApiWrapper, keepAGENT_WS_URLunchanged, and manageagent_api.connect()/agent_api.close()aroundsync_forever(). - Stubbed
sdk/agent_session.pyas a compatibility placeholder. - Updated Matrix/runtime tests away from
thread_keyand per-request websocket assumptions.
Verification
pytest tests/platform/test_real.py -qpytest tests/adapter/matrix/test_dispatcher.py -qpytest tests/core/test_integration.py -qpytest tests/platform/test_agent_session.py -q
All listed commands passed locally.