Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

feat(chat): let the agent find, load, and switch into its own past chats

merged#2855CedarCopilot

CedarCopilot wants to merge 6 commits into staging from feat/chat-history-search-agent-tool

Potential production issues

Agent tool calls may lose their request context after this change

A wrapped agent tool no longer receives the request context supplied by its caller. The same check passes on the current base and fails on this PR revision.

When an agent invokes a tool through the master tool surface.

Suggested fix: Preserve the caller's request context when wrapping the master tool execution, then rerun the same check on both revisions.

Technical evidence

The same behavior check passed on the current base and failed on this change.

Observed difference: withApprovalContext's wrapped execute still receives the real requestContext

Related changed code: apps/server/src/mastra/tools/master-surface.ts.

run 51d3d974-b7f8-49f8-aa48-202259d13fe4, completed Sep 21, 2026, 5:37 AM