Commit graph

45 commits

Author SHA1 Message Date
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
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
379cc992f4 multi_agent_chat/subagents: expose knowledge_base as ask_knowledge_base tool for siblings 2026-05-12 20:03:59 +02:00
CREDO23
d843468256 multi_agent_chat/subagents: dict-keyed middleware_stack + always-on KB 2026-05-12 18:04:54 +02:00
CREDO23
3f77c74daf multi_agent_chat: drop general_purpose subagent and dead permission plumbing 2026-05-12 12:00:59 +02:00
CREDO23
bce21dc4ce subagents/knowledge_base: universalize KB subagent across cloud + desktop modes 2026-05-12 10:51:32 +02:00
CREDO23
df2afed18d subagents/knowledge_base: wire KB specialist into orchestrator (renderer/projector split, FS middleware stack, cloud-mode gating) 2026-05-11 20:43:44 +02:00
CREDO23
09fc99c435 subagents/knowledge_base: scaffold KB specialist subagent (description, system_prompt with infer-first path resolution + discover-existing-conventions principle, factory shell; not yet wired into registry) 2026-05-11 17:25:01 +02:00
CREDO23
44fcb34708 refactor(teams subagent): rewrite system_prompt with native-tool heuristic pattern; trim description to actual tool surface 2026-05-11 14:59:13 +02:00
CREDO23
f45a42e2f6 refactor(luma subagent): rewrite system_prompt with native-tool heuristic pattern; polish description with user-surface verbs 2026-05-11 14:59:06 +02:00
CREDO23
f383de04a4 refactor(discord subagent): rewrite system_prompt with native-tool heuristic pattern; trim description to actual tool surface 2026-05-11 14:58:57 +02:00
CREDO23
6ef4f5ff45 refactor(google_drive subagent): rewrite system_prompt with native-tool heuristic pattern; trim description to actual tool surface 2026-05-11 14:50:05 +02:00
CREDO23
68a3f03347 subagents/onedrive: rewrite system prompt on the native-tool shape (always-Word constraint with block-on-other-formats, KB-indexed name resolution, outcome mapping) and trim description verbing to match actual tool surface. 2026-05-11 14:44:20 +02:00
CREDO23
9d6f0d732f subagents/dropbox: rewrite system prompt on the native-tool shape (Paper-vs-Docx file-type signals, KB-indexed name resolution, outcome mapping) and trim description verbing to match actual tool surface. 2026-05-11 14:41:23 +02:00
CREDO23
ddcb5e26e5 subagents/confluence: rewrite system prompt on the native-tool shape (HTML storage-format guidance, REPLACE-semantics-with-no-read limitation, outcome mapping) and trim description verbing to match actual tool surface. 2026-05-11 14:36:42 +02:00
CREDO23
99610ea2d9 subagents/calendar: rewrite system prompt on the native-tool shape (infer-first inputs, all-day vs timed datetime semantics, search-disambiguation, outcome mapping) and trim description verbing to match actual tool surface. 2026-05-11 14:32:26 +02:00
CREDO23
2f9b06832f subagents/gmail: rewrite system prompt on the native-tool shape (infer-first inputs, irreversibility safety, outcome mapping, MCP-aligned contract) and trim description verbing to match actual tool surface. 2026-05-11 14:24:04 +02:00
CREDO23
dc7a096d97 subagents/notion: rewrite system prompt as native-tool pilot with infer-first inputs, outcome mapping, and MCP-aligned contract. 2026-05-11 12:24:48 +02:00
CREDO23
a4c684a333 subagents/clickup: rewrite system prompt on the linear pilot shape and expand allowlist for workspace hierarchy, list, member lookup, task create and update. 2026-05-11 11:56:00 +02:00
CREDO23
8ff9916d02 subagents/slack: rewrite system prompt on the linear pilot shape and expand allowlist for message search, user search, and send message. 2026-05-11 11:49:13 +02:00
CREDO23
62a5158089 subagents/connectors: airtable system prompt and allowlist rewrite, lead linear/jira resolution principle with "Proactively look up". 2026-05-11 11:43:07 +02:00
CREDO23
7fba56862e subagents/connectors: delete orphan pre-MCP issue-mutation tool files from jira and linear routes (MCP supplies these now). 2026-05-11 11:30:58 +02:00
CREDO23
9b8ebbab2c subagents/jira: rewrite system prompt on the linear pilot shape and expand allowlist for issue lookup, transitions, accountId, and required-field schema. 2026-05-11 11:23:59 +02:00
CREDO23
54f3e8c075 subagents/linear: drop enumerated state defaults and tool-category shortcuts in vocabulary and resolution principle. 2026-05-11 11:23:52 +02:00
CREDO23
8ed7a43d63 subagents/linear: rewrite system prompt with heuristic shape and align description with read-only cycle handling. 2026-05-11 11:00:50 +02:00
CREDO23
10334fbdf0 subagents: align builtin descriptions (deliverables, memory, research) on the new shape. 2026-05-11 10:09:04 +02:00
CREDO23
d8ad0105d7 subagents: align remaining connector descriptions on the new identity-first routing shape. 2026-05-11 10:08:56 +02:00
CREDO23
c4d3a748cf subagents: rewrite routing descriptions with platform-native verbs for notion, jira, linear, gmail, calendar, slack. 2026-05-11 10:08:49 +02:00
CREDO23
2ab6b1c757 Merge upstream/dev into feature/multi-agent. 2026-05-09 23:00:56 +02:00
CREDO23
2e132513be chat: unify HITL approval UX behind a single paginated card and harden timeline supersede. 2026-05-09 21:44:54 +02:00
DESKTOP-RTLN3BA\$punk
5e87a7a251 fix: composio tool calls in composio connectors 2026-05-05 18:57:10 -07:00
CREDO23
7690e8b278 refactor(multi-agent): relocate general-purpose subagent next to other builtins 2026-05-05 20:54:45 +02:00
CREDO23
5119915f4f Merge upstream/dev into feature/multi-agent 2026-05-05 01:44:46 +02:00
CREDO23
972650909c Rename package: multi_agent_chat 2026-05-04 21:57:05 +02:00