it0/packages
hailin 495407d25b fix(agent): pass sessionId to system prompt for text chat OAuth trigger
Text sessions were not passing sessionId to SystemPromptBuilder, causing
Claude to use the `initiate_dingtalk_binding` custom tool (claude_api only).
When the engine is claude_agent_sdk, this tool does not exist → 404.

Fix: pass session.id as sessionId to systemPromptBuilder.build() in
agent.controller.ts. Claude will now use the wget oauth-trigger endpoint
for ALL session types (text and voice), which works with every engine.

Also: store userId (staffId) as the DingTalk binding ID when resolvable,
falling back to openId. Bot messages deliver senderStaffId which matches
userId, not openId — this prevents the "binding not found" routing failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 14:20:58 -07:00
..
gateway feat(dingtalk): OAuth one-tap binding + voice tool + public Kong route 2026-03-08 09:09:00 -07:00
openclaw-bridge feat(dingtalk+bridge): event-based agent reply + greeting on binding 2026-03-08 13:18:52 -07:00
services fix(agent): pass sessionId to system prompt for text chat OAuth trigger 2026-03-08 14:20:58 -07:00
shared feat(dingtalk): unified DingTalk bot router with binding flow 2026-03-08 08:12:27 -07:00