Commit graph

670 commits

Author SHA1 Message Date
CREDO23
0cdda14922 perf(kb subagent, desktop): cap evidence.content_excerpt to 500 chars 2026-05-20 09:43:36 +02:00
CREDO23
5edf0520c4 perf(kb subagent, cloud): cap evidence.content_excerpt to 500 chars 2026-05-20 09:43:32 +02:00
CREDO23
b554c600bb perf(research subagent): cap evidence.findings and evidence.sources to bound output 2026-05-20 09:42:57 +02:00
CREDO23
6c173dc2a7 perf(teams subagent): stop echoing raw teams/channels/messages payload into evidence.items 2026-05-20 09:42:03 +02:00
CREDO23
20f7896a99 perf(luma subagent): stop echoing raw events list into evidence.items 2026-05-20 09:41:47 +02:00
CREDO23
f4e66718be perf(discord subagent): stop echoing raw channels/messages payload into evidence.items 2026-05-20 09:41:36 +02:00
CREDO23
56d8ff89e2 perf(airtable subagent): stop echoing raw records list into evidence.items 2026-05-20 09:41:18 +02:00
CREDO23
1b2f13e25c perf(clickup subagent): stop echoing raw tasks list into evidence.items 2026-05-20 09:41:04 +02:00
CREDO23
6be1b22ef6 perf(jira subagent): stop echoing raw issues list into evidence.items 2026-05-20 09:40:48 +02:00
CREDO23
6e5dd54bbf perf(slack subagent): stop echoing raw messages list into evidence.items 2026-05-20 09:40:33 +02:00
CREDO23
d3d396a473 perf(linear subagent): stop echoing raw issues list into evidence.items 2026-05-20 09:40:18 +02:00
CREDO23
553becea28 perf(gmail subagent): stop echoing raw emails array into evidence.items 2026-05-20 09:40:00 +02:00
CREDO23
3a5e16e868 perf(calendar): stop echoing raw events into evidence.items 2026-05-19 21:30:28 +02:00
CREDO23
b3b66e4c48 perf(new-chat): add memory_injection middleware timing log 2026-05-19 21:30:19 +02:00
CREDO23
1df40fbe31 perf(new-chat): add knowledge_tree middleware timing log 2026-05-19 21:30:14 +02:00
CREDO23
bd153d3cdb perf(multi-agent): add kb_context_projection timing log 2026-05-19 21:30:09 +02:00
CREDO23
33bfce4406 perf(subagent): add atask EXIT breakdown timing log 2026-05-19 21:30:05 +02:00
CREDO23
9e81f2a35b perf(subagent): add subagent compile timing log 2026-05-19 21:30:01 +02:00
CREDO23
9bfba34e8e perf(mcp): add per-call, discovery, and oauth-refresh timing logs 2026-05-19 21:29:56 +02:00
DESKTOP-RTLN3BA\$punk
c187b04e82 chore: linting 2026-05-15 17:33:44 -07:00
CREDO23
98b6977c68 permissions/ask: gate 'approve_always' palette entry on MCP-ness
Only MCP tools have a persistence target for 'approve_always' (the
connector's trusted-tools list); for native tools the decision lives
only in the in-memory runtime ruleset. Reflect that in the wire palette
so the FE can stay a pure renderer of allowed_decisions instead of
peeking at context.mcp_connector_id to decide whether to show the
'Always Allow' button.

The backend still accepts an 'approve_always' reply for any tool kind
(in-memory promotion is harmless), it just doesn't advertise it when
there's nowhere to persist.
2026-05-15 14:54:16 +02:00
CREDO23
c8b756ae8f hitl/wire: rename 'always' decision-type to 'approve_always'
Renames the SurfSense HITL extension decision-type from "always" to
"approve_always" so it sits in the same verb-first family as "approve",
"reject", and "edit". The Python constant is now SURFSENSE_DECISION_APPROVE_ALWAYS;
the wire value, the permission-domain decision_type, and the FE union members
all match (no wire/internal mismatch).

Both the multi_agent_chat permission middleware and the legacy new_chat one
accept the new wire value; the FE types.ts union is updated accordingly.

The "context.always" payload key is intentionally left untouched - it's the
patterns-to-promote field, semantically distinct from the decision type.
2026-05-15 14:47:32 +02:00
CREDO23
6671c91841 multi_agent_chat/permissions: persist 'always' decisions to trusted-tools list
Until now an "Always Allow" reply only updated the in-memory runtime
ruleset, evaporating after the session ended. Persist it to the
existing connector.config['trusted_tools'] list so the next session's
fetch_user_allowlist_rulesets picks it up and the user is never asked
again for the same (connector, tool) pair.

- TrustedToolSaver + make_trusted_tool_saver(user_id) in
  user_tool_allowlist: opens its own session via async_session_maker
  per call, logs and swallows failures (in-memory promotion is the
  canonical "always" path, durable persistence is opportunistic).

- PermissionMiddleware._process is now pure: returns
  (state_update, list[_AlwaysPromotion]). aafter_model awaits the
  saver for each promotion; after_model discards them. Promotions are
  only emitted for tools whose metadata exposes mcp_connector_id, so
  native tools and KB FS ops are correctly skipped.

- main_agent factory builds the saver once per turn and stashes it in
  dependencies["trusted_tool_saver"]; pack_subagent and the KB
  middleware stack forward it through build_permission_mw.

- Renamed pm._process(state, None) call sites in two existing tests to
  pm.after_model(state, None) so they exercise the public hook
  contract instead of the now-tuple-returning private method.
2026-05-15 14:07:08 +02:00
CREDO23
a97d1548a6 multi_agent_chat/permissions: surface MCP tool metadata into ask interrupts
The FE permission card needs mcp_connector_id, mcp_server, and
tool_description in the interrupt context to render "Always Allow"
against the right connected account. Thread the tool through the
ask pipeline:

- pack_subagent → build_permission_mw(tools=...) → PermissionMiddleware
  (tools_by_name) → request_permission_decision(tool=...) →
  build_permission_ask_payload(tool=...) projects card fields out of
  BaseTool.

- mcp_tool.py: stdio path now stashes mcp_connector_id in metadata for
  parity with the HTTP path.
2026-05-15 11:28:06 +02:00
CREDO23
ef1152b80e multi_agent_chat/permissions: layer user allow-list into subagent compile 2026-05-14 21:57:38 +02:00
CREDO23
31d6b43a42 multi_agent_chat/shared: drop bucket types and helpers 2026-05-14 20:10:25 +02:00
CREDO23
014801c764 multi_agent_chat/loader: MCP tools as flat list[BaseTool] per agent 2026-05-14 20:10:11 +02:00
CREDO23
5a00df8e48 multi_agent_chat/builtins: KB+deliverables+memory+research adopt RULESET + flat load_tools() 2026-05-14 20:09:55 +02:00
CREDO23
3bb90124d2 multi_agent_chat/connectors: every route declares its own RULESET + flat load_tools() 2026-05-14 20:09:49 +02:00
CREDO23
d45dfbfbd6 multi_agent_chat: pack_subagent owns per-subagent PermissionMiddleware via Ruleset 2026-05-14 20:09:29 +02:00
CREDO23
67142e68b1 multi_agent_chat: scope MCP allow/ask permissions per subagent + drop "policy" synonym 2026-05-14 18:09:14 +02:00
CREDO23
0723702320 multi_agent_chat: real-graph regressions for unified HITL paths + format pass 2026-05-14 17:41:24 +02:00
CREDO23
adb52fb575 multi_agent_chat: KB owns its ruleset, drop interrupt_on duplication 2026-05-14 17:41:07 +02:00
CREDO23
d68280113b multi_agent_chat/connectors+builtins: adopt symmetric self_gated_tool_permission_row helper 2026-05-14 17:40:59 +02:00
CREDO23
a06aec2821 multi_agent_chat/subagents: HITL umbrella + ToolKind rename 2026-05-14 17:40:29 +02:00
CREDO23
8eaab12971 multi_agent_chat/permissions: restructure slice + simplify factory 2026-05-14 17:40:12 +02:00
CREDO23
0fd87ccb7f chat/stream_resume: key Command(resume=...) by Interrupt.id for parallel HITL 2026-05-13 20:59:57 +02:00
CREDO23
583ac83735 multi_agent_chat/middleware: refresh module layout docs 2026-05-13 19:58:59 +02:00
CREDO23
22e9dd3cf3 multi_agent_chat/main_agent: routing prompt for parallel and serial specialist work 2026-05-13 19:58:34 +02:00
CREDO23
e27883e88c multi_agent_chat/middleware: stamp tool_call_id on subagent interrupts at task chokepoint 2026-05-13 19:57:02 +02:00
CREDO23
fc2c5b6445 multi_agent_chat/middleware: per-call thread_id, tcid-keyed resume, decisions slicer 2026-05-13 19:56:51 +02:00
CREDO23
246dae40a8 Merge upstream/dev into feature/multi-agent 2026-05-12 21:23:37 +02:00
CREDO23
6b60d324a3 multi_agent_chat/main_agent: one specialist per task; advertise write_todos for multi-turn plans 2026-05-12 20:39:14 +02:00
CREDO23
379cc992f4 multi_agent_chat/subagents: expose knowledge_base as ask_knowledge_base tool for siblings 2026-05-12 20:03:59 +02:00
CREDO23
f2f62c1c05 multi_agent_chat/permissions: break circular import in interrupt subpackage 2026-05-12 18:20:07 +02:00
CREDO23
d843468256 multi_agent_chat/subagents: dict-keyed middleware_stack + always-on KB 2026-05-12 18:04:54 +02:00
CREDO23
eee861bb3d multi_agent_chat/main_agent: rewrite system prompt to hierarchical prompts/ tree 2026-05-12 15:35:48 +02:00
CREDO23
9b82f2db1d multi_agent_chat/permissions: clone PermissionMiddleware with SRP split and edit support 2026-05-12 12:58:53 +02:00
CREDO23
3f77c74daf multi_agent_chat: drop general_purpose subagent and dead permission plumbing 2026-05-12 12:00:59 +02:00
CREDO23
3fb1976886 multi_agent_chat/main_agent: route KB work through task(knowledge_base) in <tool_routing> 2026-05-12 11:01:54 +02:00