AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(platform/copilot): approval cards label and word a tool's arguments from its own schema (#15061)
Reinier van der Leer1f97e743f19d
diff --git a/autogpt_platform/backend/backend/copilot/eval/style/generation.py b/autogpt_platform/backend/backend/copilot/eval/style/generation.pyindex e5438c8570..26d16709a0 100644--- a/autogpt_platform/backend/backend/copilot/eval/style/generation.py+++ b/autogpt_platform/backend/backend/copilot/eval/style/generation.py@@ -346,7 +346,7 @@ def _capability_details(capability_id: str) -> str:CapabilityDetailsResponse(message=f"{tool.description} Run it with run_capability(id='{entry.id}').",capability=entry.listing(),- parameters=tool.parameters,+ parameters=tool.model_parameters,))diff --git a/autogpt_platform/backend/backend/copilot/gate/reference_cards_test.py b/autogpt_platform/backend/backend/copilot/gate/reference_cards_test.pyindex 111853fc50..525da92b91 100644--- a/autogpt_platform/backend/backend/copilot/gate/reference_cards_test.py+++ b/autogpt_platform/backend/backend/copilot/gate/reference_cards_test.py@@ -88,6 +88,29 @@ _CALLS: list[tuple[str, str, dict[str, Any]]] = [{"file_id": "file-q3", "path": "/reports/q3-report.pdf"},),("Unresolved id", "delete_preset", {"preset_id": "3f0c9a2e-preset-gone"}),+ (+ "Follow-up in two days",+ "schedule_followup",+ {+ "message": "Check that Ada finished the partner dossiers.",+ "delay_seconds": 183_420,+ "session_id": "s-q3",+ },+ ),+ (+ "Weekly follow-up",+ "schedule_followup",+ {"message": "Review the sales pipeline.", "cron": "0 9 * * 1"},+ ),+ (+ "Delegate and wait",+ "delegate_to_expert",+ {+ "expert_id": "exp-ada",+ "prompt": "Backfill the partner dossiers for the three new accounts.",+ "wait_for_result": 180,+ },+ ),]@@ -101,6 +124,10 @@ async def build_cards() -> list[dict[str, Any]]:patch.object(references, "get_workspace_manager", _workspace),patch.object(references, "store_db", return_value=_store()),patch.object(references, "get_redis_async", _redis),+ patch(+ "backend.copilot.tools.expert_delegation.experts_db",+ return_value=_experts(),+ ),):cards = [await _card(*call) for call in _CALLS]return json.loads(json.dumps(cards, default=str))diff --git a/autogpt_platform/backend/backend/copilot/gate/references.py b/autogpt_platform/backend/backend/copilot/gate/references.pyindex 0a58d19fa3..b697620a23 100644--- a/autogpt_platform/backend/backend/copilot/gate/references.py+++ b/autogpt_platform/backend/backend/copilot/gate/references.py@@ -41,68 +41,6 @@ Entity = Literal["soul_change",]-# (tool, argument) -> what its id names. None is a decision: not a platform id.-REFERENCES: dict[tuple[str, str], Entity | None] = {- ("create_agent", "folder_id"): "library_folder",- ("create_agent", "library_agent_ids"): "library_agent",- ("customize_agent", "folder_id"): "library_folder",- ("customize_agent", "library_agent_ids"): "library_agent",- ("edit_agent", "agent_id"): "agent_or_graph",- ("edit_agent", "library_agent_ids"): "library_agent",- ("create_folder", "parent_id"): "library_folder",- ("create_folder", "icon"): None,- ("update_folder", "folder_id"): "library_folder",- ("update_folder", "icon"): None,- ("move_folder", "folder_id"): "library_folder",- ("move_folder", "target_parent_id"): "library_folder",- ("delete_folder", "folder_id"): "library_folder",- ("move_agents_to_folder", "folder_id"): "library_folder",- ("move_agents_to_folder", "agent_ids"): "library_agent",- ("update_preset", "preset_id"): "preset",- ("delete_preset", "preset_id"): "preset",- ("pause_schedule", "schedule_id"): "schedule",- ("resume_schedule", "schedule_id"): "schedule",- ("delete_schedule", "schedule_id"): "schedule",- ("schedule_followup", "session_id"): "chat_session",- ("schedule_routine", "routine_id"): "routine",- ("schedule_routine", "session_id"): "chat_session",- ("schedule_routine", "expert_id"): "expert",- ("setup_agent_webhook_trigger", "library_agent_id"): "library_agent",- ("setup_agent_webhook_trigger", "graph_id"): "graph",- ("hire_expert", "template_id"): "expert_template",- ("update_expert", "expert_id"): "expert",- ("confirm_expert_change", "confirmation_id"): "team_change",- ("confirm_expert_soul_update", "confirmation_id"): "soul_change",- ("install_expert_workflow", "library_agent_id"): "library_agent",- ("install_expert_workflow", "store_listing_version_id"): "store_listing",- ("install_expert_workflow", "expert_id"): "expert",- ("remove_expert_workflow", "workflow_id"): "expert_workflow",- ("remove_expert_workflow", "library_agent_id"): "library_agent",- ("remove_expert_workflow", "expert_id"): "expert",- ("grant_expert_credential", "credential_id"): "credential",- ("grant_expert_credential", "expert_id"): "expert",- ("revoke_expert_credential", "credential_id"): "credential",- ("revoke_expert_credential", "expert_id"): "expert",- ("delegate_to_expert", "expert_id"): "expert_or_name",- ("delegate_to_expert", "delegated_session_id"): "chat_session",- ("handoff_to_expert", "expert_id"): "expert",- ("message_session", "session_id"): "chat_session",- ("run_sub_session", "sub_autopilot_session_id"): "chat_session",- ("delete_skill", "expert_id"): "expert",- ("delete_workspace_file", "file_id"): "workspace_file",- ("run_agent", "library_agent_id"): "agent_or_graph",- ("run_agent", "preset_id"): "preset",- # Another system's ids, or not ids at all though described as one.- ("create_feature_request", "existing_issue_id"): None,- ("edit_chat_platform_message", "channel_id"): None,- ("edit_chat_platform_message", "ref_id"): None,- ("memory_forget_confirm", "uuids"): None,- ("browser_act", "target"): None,- ("post_to_chat_platform", "channel"): None,- # A block or MCP server; the card's subject already names it.- ("run_capability", "id"): None,-}-LOOKUP_SECONDS = 1.0CARD_SECONDS = 2.0# Ids of a list resolved for the card; the rest read "+N more".@@ -165,18 +103,27 @@ async def resolve_references(def wanted_references(tool_name: str, args: dict[str, Any]) -> list[Reference]:+ """The ids whose schema names the entity; ``"entity": None`` is not ours."""refs: list[Reference] = []- for (tool, key), entity in REFERENCES.items():- if tool != tool_name or entity is None:+ for key, entity in declared_entities(tool_name).items():+ if entity is None:continue- value = args.get(key)refs.extend(Reference(key=key, entity=entity, id=id)- for id in listed_ids(value)[:MAX_LISTED]+ for id in listed_ids(args.get(key))[:MAX_LISTED])return refs+def declared_entities(tool_name: str) -> dict[str, Entity | None]:+ """Each argument whose schema says what platform thing its id names."""+ from backend.copilot.tools import get_tool # the tools package imports the gate++ tool = get_tool(tool_name)+ props = (tool.parameters.get("properties") or {}) if tool else {}+ return {key: spec["entity"] for key, spec in props.items() if "entity" in spec}++def listed_ids(value: Any) -> list[str]:"""The ids an argument holds, blanks and non-strings dropped."""values = value if isinstance(value, list) else [value]diff --git a/autogpt_platform/backend/backend/copilot/gate/references_test.py b/autogpt_platform/backend/backend/copilot/gate/references_test.pyindex 62aafadb18..f1020a20f9 100644--- a/autogpt_platform/backend/backend/copilot/gate/references_test.py+++ b/autogpt_platform/backend/backend/copilot/gate/references_test.py@@ -13,9 +13,9 @@ from backend.api.features.library.model import LibraryFolderfrom backend.copilot.gate import referencesfrom backend.copilot.gate.headline import _OBJECT_ID, gated_tools, headline_forfrom backend.copilot.gate.references import (- REFERENCES,Fact,Reference,+ declared_entities,resolve_references,wanted_references,)@@ -29,7 +29,7 @@ _ID_NAME = re.compile(r"(^|_)(ids?|uuids?)$|Ids?$")_ID_WORD = re.compile(r"\b(id|ID|ids|IDs|uuid|UUID|identifier)\b")-def test_every_id_shaped_input_of_a_gated_tool_has_a_decided_row():+def test_every_id_shaped_input_of_a_gated_tool_declares_its_entity():"""A new tool's id must not fall back to a raw uuid unnoticed."""from backend.copilot.tools import get_tool@@ -41,20 +41,23 @@ def test_every_id_shaped_input_of_a_gated_tool_has_a_decided_row():shaped = _ID_NAME.search(key) or _ID_WORD.search(spec.get("description") or "")- if shaped and (tool_name, key) not in REFERENCES:+ if shaped and "entity" not in spec:missing.append(f"{tool_name}.{key}")- assert missing == [], "add a row (or a None row) to gate/references.py"+ assert missing == [], 'give the parameter an "entity" (None if not ours)'-def test_every_row_names_a_gated_tool_and_every_entity_a_resolver():- assert {tool for tool, _ in REFERENCES} <= gated_tools()- entities = {entity for entity in REFERENCES.values() if entity}- assert entities == set(references._RESOLVERS)+def test_every_declared_entity_has_a_resolver_and_every_resolver_a_gated_use():+ from backend.copilot.tools import TOOL_REGISTRY+ declared = {e for t in TOOL_REGISTRY for e in declared_entities(t).values() if e}+ assert declared <= set(references._RESOLVERS)+ gated = {e for t in gated_tools() for e in declared_entities(t).values() if e}+ assert gated == set(references._RESOLVERS)-def test_every_headline_id_is_one_the_table_resolves():++def test_every_headline_id_is_one_its_schema_resolves():for tool, key in _OBJECT_ID.items():- assert REFERENCES.get((tool, key)), f"{tool}.{key}"+ assert declared_entities(tool).get(key), f"{tool}.{key}"async def test_a_single_id_resolves_to_its_name_and_page():diff --git a/autogpt_platform/backend/backend/copilot/gate/review.py b/autogpt_platform/backend/backend/copilot/gate/review.pyindex 0d9a27d43d..2d3be33f32 100644--- a/autogpt_platform/backend/backend/copilot/gate/review.py+++ b/autogpt_platform/backend/backend/copilot/gate/review.py@@ -60,6 +60,8 @@ class Subject(BaseModel):class FieldLabel(BaseModel):key: strlabel: str+ # How the card words the value, from the schema's ``format``.+ format: str | None = Noneclass GateReviewPayload(BaseModel):@@ -342,7 +344,7 @@ def _payload_subject(def _field_labels(tool_name: str, shown: dict[str, Any]) -> list[FieldLabel]:- """Labels and order from the tool's own input schema, required first."""+ """Labels, formats and order from the tool's own input schema, required first."""from backend.copilot.tools import get_tool # imports the gatetool = get_tool(tool_name)@@ -352,7 +354,11 @@ def _field_labels(tool_name: str, shown: dict[str, Any]) -> list[FieldLabel]:order = required + [k for k in props if k not in required]order += [k for k in shown if k not in order]return [- FieldLabel(key=key, label=(props.get(key) or {}).get("title") or _humanize(key))+ FieldLabel(+ key=key,+ label=(props.get(key) or {}).get("title") or _humanize(key),+ format=(props.get(key) or {}).get("format"),+ )for key in orderif key in shown]diff --git a/autogpt_platform/backend/backend/copilot/gate/review_test.py b/autogpt_platform/backend/backend/copilot/gate/review_test.pyindex 812de7e736..960447a254 100644--- a/autogpt_platform/backend/backend/copilot/gate/review_test.py+++ b/autogpt_platform/backend/backend/copilot/gate/review_test.py@@ -120,14 +120,18 @@ def test_every_tool_the_gate_can_hold_has_its_own_words():assert gated_tools() == held-def test_fields_follow_the_schema_required_first_with_labels():+def test_fields_follow_the_schema_required_first_with_labels_and_formats():payload = review_payload(- "create_folder", {"parent_id": "p1", "name": "Q3", "extra": 1}+ "schedule_followup", {"delay_seconds": 183_420, "message": "Ping", "extra": 1})- keys = [field["key"] for field in payload["fields"]]- assert keys[0] == "name"- assert keys[-1] == "extra"- assert {"key": "extra", "label": "Extra"} in payload["fields"]+ fields = payload["fields"]+ assert [field["key"] for field in fields] == ["message", "delay_seconds", "extra"]+ assert fields[1] == {+ "key": "delay_seconds",+ "label": "Runs in",+ "format": "seconds",+ }+ assert fields[2] == {"key": "extra", "label": "Extra", "format": None}def test_a_clipped_argument_is_named_so_the_card_can_say_so():diff --git a/autogpt_platform/backend/backend/copilot/sdk/tool_adapter.py b/autogpt_platform/backend/backend/copilot/sdk/tool_adapter.pyindex 516266ba72..3816dc52c9 100644--- a/autogpt_platform/backend/backend/copilot/sdk/tool_adapter.py+++ b/autogpt_platform/backend/backend/copilot/sdk/tool_adapter.py@@ -474,7 +474,7 @@ def _build_input_schema(base_tool: BaseTool) -> dict[str, Any]:"""return {"type": "object",- "properties": base_tool.parameters.get("properties", {}),+ "properties": base_tool.model_parameters.get("properties", {}),}diff --git a/autogpt_platform/backend/backend/copilot/tools/agent_browser.py b/autogpt_platform/backend/backend/copilot/tools/agent_browser.pyindex 51c6334d01..5b7445f911 100644--- a/autogpt_platform/backend/backend/copilot/tools/agent_browser.py+++ b/autogpt_platform/backend/backend/copilot/tools/agent_browser.py@@ -702,6 +702,7 @@ class BrowserActTool(BaseTool):"target": {"type": "string","description": "@ref ID (e.g. '@e3'), CSS selector, or text. Required for: click, dblclick, fill, type, hover, check, uncheck, select. For wait: CSS selector or milliseconds string (e.g. '1000').",+ "entity": None,},"value": {"type": "string",diff --git a/autogpt_platform/backend/backend/copilot/tools/base.py b/autogpt_platform/backend/backend/copilot/tools/base.pyindex 75cbf1869c..22b259ba67 100644--- a/autogpt_platform/backend/backend/copilot/tools/base.py+++ b/autogpt_platform/backend/backend/copilot/tools/base.py@@ -339,6 +339,11 @@ class BaseTool:"""Tool parameters schema for OpenAI."""raise NotImplementedError+ @property+ def model_parameters(self) -> dict[str, Any]:+ """``parameters`` as the model is sent them: without the card's hints."""+ return without_card_hints(self.parameters)+@propertydef requires_auth(self) -> bool:"""Whether this tool requires authentication."""@@ -392,7 +397,7 @@ class BaseTool:function={"name": self.name,"description": self.description,- "parameters": self.parameters,+ "parameters": self.model_parameters,},)@@ -698,3 +703,21 @@ class BaseTool:"""raise NotImplementedError+++# Read by the approval card (gate/review.py, gate/references.py), never by the+# model: a label, how to show the value, and what platform thing an id names.+CARD_HINTS = frozenset({"title", "format", "entity"})+++def without_card_hints(schema: dict[str, Any]) -> dict[str, Any]:+ properties = schema.get("properties")+ if not properties:+ return schema+ return {+ **schema,+ "properties": {+ key: {k: v for k, v in spec.items() if k not in CARD_HINTS}+ for key, spec in properties.items()+ },+ }diff --git a/autogpt_platform/backend/backend/copilot/tools/bash_exec.py b/autogpt_platform/backend/backend/copilot/tools/bash_exec.pyindex b27b0fa45f..2ff138931d 100644--- a/autogpt_platform/backend/backend/copilot/tools/bash_exec.py+++ b/autogpt_platform/backend/backend/copilot/tools/bash_exec.py@@ -186,6 +186,8 @@ class BashExecTool(BaseTool):"type": "integer","description": "Timeout in seconds; raise for long-running commands.","default": 120,+ "title": "Time limit",+ "format": "seconds",},},"required": ["command"],diff --git a/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py b/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.pyindex 83e5f32757..ad05fc8de1 100644--- a/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py+++ b/autogpt_platform/backend/backend/copilot/tools/capability_tools_test.py@@ -25,6 +25,7 @@ from backend.copilot.tools import ()from ._test_data import make_session+from .base import without_card_hintsfrom .describe_capability import DescribeCapabilityToolfrom .find_capability import FindCapabilityToolfrom .models import (@@ -441,13 +442,13 @@ async def test_a_skill_id_never_resolves_to_the_platform_tool_of_that_name(skillassert isinstance(result, ErrorResponse)-async def test_describe_tool_returns_parameters():+async def test_describe_tool_returns_parameters_without_the_card_hints():result = await DescribeCapabilityTool()._execute(- USER, make_session(USER), id="tool:list_schedules"+ USER, make_session(USER), id="tool:schedule_followup")assert isinstance(result, CapabilityDetailsResponse)- assert result.capability["id"] == "tool:list_schedules"- assert result.parameters == TOOL_REGISTRY["list_schedules"].parameters+ assert result.capability["id"] == "tool:schedule_followup"+ assert result.parameters == TOOL_REGISTRY["schedule_followup"].model_parametersasync def test_describe_block_collapses_large_enums_unless_expanded():@@ -527,7 +528,11 @@ def _stub_tool(name: str) -> MagicMock:tool = MagicMock()tool.name = nametool.description = "stub"- tool.parameters = {"type": "object", "properties": {"x": {"type": "string"}}}+ tool.parameters = {+ "type": "object",+ "properties": {"x": {"type": "string", "title": "X"}},+ }+ tool.model_parameters = without_card_hints(tool.parameters)tool._execute = AsyncMock(return_value=ErrorResponse(message="ran", session_id="s"))return tool@@ -549,7 +554,10 @@ async def test_run_tool_describes_without_running():validate_only=True,)assert isinstance(result, CapabilityDetailsResponse)- assert result.parameters == stub.parameters+ assert result.parameters == {+ "type": "object",+ "properties": {"x": {"type": "string"}},+ }stub._execute.assert_not_awaited()diff --git a/autogpt_platform/backend/backend/copilot/tools/chat_platform.py b/autogpt_platform/backend/backend/copilot/tools/chat_platform.pyindex c7a0c87318..0e6426ca09 100644--- a/autogpt_platform/backend/backend/copilot/tools/chat_platform.py+++ b/autogpt_platform/backend/backend/copilot/tools/chat_platform.py@@ -266,10 +266,12 @@ class PostToChatPlatformTool(BaseTool):"Channel name (#standup) or numeric ID. Required ""unless target='dm'."),+ "entity": None,},"content": {"type": "string","description": "Message body to post.",+ "title": "Message",},"mode": {"type": "string",@@ -466,6 +468,7 @@ class EditChatPlatformMessageTool(BaseTool):"The `channel_id` post_to_chat_platform returned for ""the message being edited."),+ "entity": None,},"ref_id": {"type": "string",@@ -473,10 +476,13 @@ class EditChatPlatformMessageTool(BaseTool):"The `ref_id` post_to_chat_platform returned for the ""message being edited."),+ "title": "Message",+ "entity": None,},"content": {"type": "string","description": "New message body, replacing the original content.",+ "title": "New text",},},"required": ["channel_id", "ref_id", "content"],diff --git a/autogpt_platform/backend/backend/copilot/tools/confirm_expert_change.py b/autogpt_platform/backend/backend/copilot/tools/confirm_expert_change.pyindex 97a5c5eb6f..d3276683a0 100644--- a/autogpt_platform/backend/backend/copilot/tools/confirm_expert_change.py+++ b/autogpt_platform/backend/backend/copilot/tools/confirm_expert_change.py@@ -58,6 +58,7 @@ class ConfirmExpertChangeTool(BaseTool):"confirmation_id": {"type": "string","description": "The id returned by hire_expert/raise_expert.",+ "entity": "team_change",},},"required": ["confirmation_id"],diff --git a/autogpt_platform/backend/backend/copilot/tools/create_agent.py b/autogpt_platform/backend/backend/copilot/tools/create_agent.pyindex 6d8795a889..3dc7cc176b 100644--- a/autogpt_platform/backend/backend/copilot/tools/create_agent.py+++ b/autogpt_platform/backend/backend/copilot/tools/create_agent.py@@ -51,6 +51,8 @@ class CreateAgentTool(BaseTool):"type": "array","items": {"type": "string"},"description": "Library agent IDs as building blocks.",+ "title": "Building blocks",+ "entity": "library_agent",},"save": {"type": "boolean",@@ -60,6 +62,7 @@ class CreateAgentTool(BaseTool):"folder_id": {"type": "string","description": "Folder ID to save into (default: root).",+ "entity": "library_folder",},"is_hidden": {"type": "boolean",@@ -70,11 +73,13 @@ class CreateAgentTool(BaseTool):"from AgentExecutorBlock usage in the graph)."),"default": False,+ "title": "Hidden from your library",},"library_check_ack": {"type": "boolean","description": "Bypass library-similarity gate after user declined.","default": False,+ "title": "Skips the library check",},},"required": [],diff --git a/autogpt_platform/backend/backend/copilot/tools/customize_agent.py b/autogpt_platform/backend/backend/copilot/tools/customize_agent.pyindex e8851f22df..a57f327999 100644--- a/autogpt_platform/backend/backend/copilot/tools/customize_agent.py+++ b/autogpt_platform/backend/backend/copilot/tools/customize_agent.py@@ -47,6 +47,8 @@ class CustomizeAgentTool(BaseTool):"type": "array","items": {"type": "string"},"description": "Library agent IDs as building blocks.",+ "title": "Building blocks",+ "entity": "library_agent",},"save": {"type": "boolean",@@ -56,6 +58,7 @@ class CustomizeAgentTool(BaseTool):"folder_id": {"type": "string","description": "Folder ID to save into (default: root).",+ "entity": "library_folder",},},"required": [],diff --git a/autogpt_platform/backend/backend/copilot/tools/delegate_to_expert.py b/autogpt_platform/backend/backend/copilot/tools/delegate_to_expert.pyindex 4e8b139358..ecd951721b 100644--- a/autogpt_platform/backend/backend/copilot/tools/delegate_to_expert.py+++ b/autogpt_platform/backend/backend/copilot/tools/delegate_to_expert.py@@ -101,6 +101,7 @@ class DelegateToExpertTool(BaseTool):"<team_context>, or their exact name if you don't ""have the id. Must not be you."),+ "entity": "expert_or_name",},"prompt": {"type": "string",@@ -109,11 +110,13 @@ class DelegateToExpertTool(BaseTool):"context they need — they cannot see this ""conversation."),+ "title": "Task",},"system_context": {"type": "string","description": "Optional context prepended to the prompt.","default": "",+ "title": "Background",},"delegated_session_id": {"type": "string",@@ -121,6 +124,8 @@ class DelegateToExpertTool(BaseTool):"Continue a prior delegation to this teammate; empty = new."),"default": "",+ "title": "Continues",+ "entity": "chat_session",},"wait_for_result": {"type": "integer",@@ -129,6 +134,8 @@ class DelegateToExpertTool(BaseTool):f"Clamped to {MAX_SUB_SESSION_WAIT_SECONDS}."),"default": 60,+ "title": "Waits up to",+ "format": "seconds",},},"required": ["expert_id", "prompt"],diff --git a/autogpt_platform/backend/backend/copilot/tools/describe_capability.py b/autogpt_platform/backend/backend/copilot/tools/describe_capability.pyindex f18821289b..7d594ae56d 100644--- a/autogpt_platform/backend/backend/copilot/tools/describe_capability.py+++ b/autogpt_platform/backend/backend/copilot/tools/describe_capability.py@@ -188,7 +188,7 @@ def describe_expert(entry: CapabilityEntry, session_id: str) -> ToolResponseBasef"id='{entry.id}', input={{...}}) calls {name}. {tool.description}"),capability=entry.listing(),- parameters=_without_properties(tool.parameters, set(bound)),+ parameters=_without_properties(tool.model_parameters, set(bound)),session_id=session_id,).from_outside()@@ -211,7 +211,8 @@ def _describe_tool(tool = configured_tool(entry.implementations[0].ref)if tool is None:return ErrorResponse(message=UNKNOWN_ID_HINT, session_id=session_id)- parameters = tool.parameters if expand else collapse_large_enums(tool.parameters)+ parameters = tool.model_parameters+ parameters = parameters if expand else collapse_large_enums(parameters)return CapabilityDetailsResponse(message=(f"{tool.description} Run it with run_capability(id='{entry.id}', "diff --git a/autogpt_platform/backend/backend/copilot/tools/edit_agent.py b/autogpt_platform/backend/backend/copilot/tools/edit_agent.pyindex 00a32f033c..3f1782304b 100644--- a/autogpt_platform/backend/backend/copilot/tools/edit_agent.py+++ b/autogpt_platform/backend/backend/copilot/tools/edit_agent.py@@ -48,6 +48,7 @@ class EditAgentTool(BaseTool):"agent_id": {"type": "string","description": "Graph ID or library agent ID to edit.",+ "entity": "agent_or_graph",},"agent_json": AGENT_JSON_SCHEMA,"agent_json_ref": AGENT_JSON_REF_SCHEMA,@@ -55,6 +56,8 @@ class EditAgentTool(BaseTool):"type": "array","items": {"type": "string"},"description": "Library agent IDs as building blocks.",+ "title": "Building blocks",+ "entity": "library_agent",},"save": {"type": "boolean",diff --git a/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py b/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.pyindex 83623d3d5c..2695205576 100644--- a/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py+++ b/autogpt_platform/backend/backend/copilot/tools/expert_capabilities_test.py@@ -20,6 +20,7 @@ from backend.copilot.gate.content import ContentVerdictfrom backend.copilot.model import ChatSessionMetadatafrom backend.copilot.permissions import CopilotPermissionsfrom backend.copilot.tools import (+ TOOL_REGISTRY,expert_tool_disabled_groups,origin_disabled_tools,tool_names_in_groups,@@ -157,6 +158,20 @@ async def test_describe_expert_asks_only_for_what_the_id_does_not_carry(team):assert result.parameters["required"] == []+async def test_describe_teammate_sends_the_model_no_card_hints(team):+ # delegate_to_expert's schema labels its arguments for the approval card;+ # the model gets the same parameters as from the tool itself.+ result = await DescribeCapabilityTool()._execute(+ USER, make_session(USER), id="teammate:exp-vera"+ )++ assert isinstance(result, CapabilityDetailsResponse)+ expected = TOOL_REGISTRY["delegate_to_expert"].model_parameters["properties"]+ assert result.parameters["properties"] == {+ key: spec for key, spec in expected.items() if key != "expert_id"+ }++@pytest.mark.parametrize("validate_only", [True, False])async def test_run_capability_itself_describes_an_expert_and_hires_no_one(team, validate_onlydiff --git a/autogpt_platform/backend/backend/copilot/tools/expert_resources.py b/autogpt_platform/backend/backend/copilot/tools/expert_resources.pyindex 82b8b08b22..779c208736 100644--- a/autogpt_platform/backend/backend/copilot/tools/expert_resources.py+++ b/autogpt_platform/backend/backend/copilot/tools/expert_resources.py@@ -25,6 +25,7 @@ logger = logging.getLogger(__name__)_EXPERT_ID_PARAM = {"type": "string","description": "Target expert (AutoPilot only; experts act on themselves).",+ "entity": "expert",}@@ -61,14 +62,21 @@ class InstallExpertWorkflowTool(BaseTool):return {"type": "object","properties": {- "library_agent_id": {"type": "string", "description": "Library agent."},+ "library_agent_id": {+ "type": "string",+ "description": "Library agent.",+ "entity": "library_agent",+ },"username_agent_slug": {"type": "string","description": "Marketplace 'creator/slug'.",+ "title": "Marketplace agent",},"store_listing_version_id": {"type": "string","description": "Marketplace listing version.",+ "title": "Marketplace agent",+ "entity": "store_listing",},"expert_id": _EXPERT_ID_PARAM,},@@ -170,8 +178,16 @@ class RemoveExpertWorkflowTool(BaseTool):return {"type": "object","properties": {- "workflow_id": {"type": "string", "description": "Installed workflow."},- "library_agent_id": {"type": "string", "description": "Library agent."},+ "workflow_id": {+ "type": "string",+ "description": "Installed workflow.",+ "entity": "expert_workflow",+ },+ "library_agent_id": {+ "type": "string",+ "description": "Library agent.",+ "entity": "library_agent",+ },"expert_id": _EXPERT_ID_PARAM,},"required": [],@@ -261,8 +277,16 @@ class GrantExpertCredentialTool(BaseTool):return {"type": "object","properties": {- "expert_id": {"type": "string", "description": "Expert to grant to."},- "credential_id": {"type": "string", "description": "Credential id."},+ "expert_id": {+ "type": "string",+ "description": "Expert to grant to.",+ "entity": "expert",+ },+ "credential_id": {+ "type": "string",+ "description": "Credential id.",+ "entity": "credential",+ },},"required": ["expert_id", "credential_id"],}@@ -301,8 +325,13 @@ class RevokeExpertCredentialTool(BaseTool):"expert_id": {"type": "string","description": "Expert to revoke from.",+ "entity": "expert",+ },+ "credential_id": {+ "type": "string",+ "description": "Credential id.",+ "entity": "credential",},- "credential_id": {"type": "string", "description": "Credential id."},},"required": ["expert_id", "credential_id"],}diff --git a/autogpt_platform/backend/backend/copilot/tools/feature_requests.py b/autogpt_platform/backend/backend/copilot/tools/feature_requests.pyindex 9086926e08..7d13f4b713 100644--- a/autogpt_platform/backend/backend/copilot/tools/feature_requests.py+++ b/autogpt_platform/backend/backend/copilot/tools/feature_requests.py@@ -252,6 +252,7 @@ class CreateFeatureRequestTool(BaseTool):"existing_issue_id": {"type": "string","description": "Linear issue ID to add need to (from search results).",+ "entity": None,},},"required": ["title", "description"],diff --git a/autogpt_platform/backend/backend/copilot/tools/fix_agent.py b/autogpt_platform/backend/backend/copilot/tools/fix_agent.pyindex 0d9333fefa..cb379b1612 100644--- a/autogpt_platform/backend/backend/copilot/tools/fix_agent.py+++ b/autogpt_platform/backend/backend/copilot/tools/fix_agent.py@@ -56,6 +56,7 @@ class FixAgentGraphTool(BaseTool):"response then returns an @@agptfile ref to pass to ""tool:create_agent / tool:edit_agent instead of the full JSON."),+ "title": "Saves the fix to",},},"required": [],diff --git a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.py b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.pyindex 40ab7c83c2..e23ae41ecf 100644--- a/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.py+++ b/autogpt_platform/backend/backend/copilot/tools/graphiti_forget.py@@ -207,11 +207,14 @@ class MemoryForgetConfirmTool(BaseTool):"type": "array","items": {"type": "string"},"description": "List of edge UUIDs to delete (from memory_forget_search results)",+ "title": "Memories",+ "entity": None,},"hard_delete": {"type": "boolean","description": "If true, permanently removes edges from the graph (GDPR). Default false (soft delete — marks as expired).","default": False,+ "title": "Deletes permanently",},},"required": ["uuids"],diff --git a/autogpt_platform/backend/backend/copilot/tools/handoff_to_expert.py b/autogpt_platform/backend/backend/copilot/tools/handoff_to_expert.pyindex 3f15d76beb..7ac5959c97 100644--- a/autogpt_platform/backend/backend/copilot/tools/handoff_to_expert.py+++ b/autogpt_platform/backend/backend/copilot/tools/handoff_to_expert.py@@ -110,6 +110,7 @@ class HandoffToExpertTool(BaseTool):"description": ("Teammate taking it over, from <team_context>. Not you."),+ "entity": "expert",},"prompt": {"type": "string",@@ -117,11 +118,13 @@ class HandoffToExpertTool(BaseTool):"The task, written for them. They cannot see this ""conversation or ask you follow-ups."),+ "title": "Task",},"context": {"type": "string","description": "Optional background; what you already tried.","default": "",+ "title": "Background",},},"required": ["expert_id", "prompt"],diff --git a/autogpt_platform/backend/backend/copilot/tools/hire_expert.py b/autogpt_platform/backend/backend/copilot/tools/hire_expert.pyindex 9eb5bf706b..8a5fff9f74 100644--- a/autogpt_platform/backend/backend/copilot/tools/hire_expert.py+++ b/autogpt_platform/backend/backend/copilot/tools/hire_expert.py@@ -68,6 +68,7 @@ class HireExpertTool(BaseTool):"template_id": {"type": "string","description": ("Roster template to hire; never invent an id."),+ "entity": "expert_template",},"name": {"type": "string",diff --git a/autogpt_platform/backend/backend/copilot/tools/manage_folders.py b/autogpt_platform/backend/backend/copilot/tools/manage_folders.pyindex 0a30093e2c..d6f6dcf711 100644--- a/autogpt_platform/backend/backend/copilot/tools/manage_folders.py+++ b/autogpt_platform/backend/backend/copilot/tools/manage_folders.py@@ -106,10 +106,13 @@ class CreateFolderTool(BaseTool):"parent_id": {"type": "string","description": "Parent folder ID (omit for root).",+ "title": "Inside folder",+ "entity": "library_folder",},"icon": {"type": "string","description": "Icon identifier.",+ "entity": None,},"color": {"type": "string",@@ -282,6 +285,7 @@ class UpdateFolderTool(BaseTool):"folder_id": {"type": "string","description": "ID of the folder to update.",+ "entity": "library_folder",},"name": {"type": "string",@@ -290,6 +294,7 @@ class UpdateFolderTool(BaseTool):"icon": {"type": "string","description": "New icon identifier.",+ "entity": None,},"color": {"type": "string",@@ -366,10 +371,13 @@ class MoveFolderTool(BaseTool):"folder_id": {"type": "string","description": "Folder ID.",+ "entity": "library_folder",},"target_parent_id": {"type": ["string", "null"],"description": "New parent folder ID (null for root).",+ "title": "Into folder",+ "entity": "library_folder",},},"required": ["folder_id"],@@ -440,6 +448,7 @@ class DeleteFolderTool(BaseTool):"folder_id": {"type": "string","description": "ID of the folder to delete.",+ "entity": "library_folder",},},"required": ["folder_id"],@@ -508,10 +517,12 @@ class MoveAgentsToFolderTool(BaseTool):"type": "array","items": {"type": "string"},"description": "Library agent IDs to move.",+ "entity": "library_agent",},"folder_id": {"type": ["string", "null"],"description": "Target folder ID (null for root).",+ "entity": "library_folder",},},"required": ["agent_ids"],diff --git a/autogpt_platform/backend/backend/copilot/tools/manage_presets.py b/autogpt_platform/backend/backend/copilot/tools/manage_presets.pyindex 960a4f0b59..7d407946eb 100644--- a/autogpt_platform/backend/backend/copilot/tools/manage_presets.py+++ b/autogpt_platform/backend/backend/copilot/tools/manage_presets.py@@ -282,6 +282,7 @@ class UpdatePresetTool(BaseTool):"preset_id": {"type": "string","description": "ID of the preset to update.",+ "entity": "preset",},"name": {"type": "string", "description": "New name."},"description": {@@ -291,6 +292,7 @@ class UpdatePresetTool(BaseTool):"is_active": {"type": "boolean","description": "Set false to pause the trigger, true to resume.",+ "title": "Active",},"inputs": {"type": "object",@@ -404,6 +406,7 @@ class DeletePresetTool(BaseTool):"preset_id": {"type": "string","description": "ID of the preset to delete.",+ "entity": "preset",},},"required": ["preset_id"],diff --git a/autogpt_platform/backend/backend/copilot/tools/manage_schedules.py b/autogpt_platform/backend/backend/copilot/tools/manage_schedules.pyindex 21edf822fc..3386f5fc2c 100644--- a/autogpt_platform/backend/backend/copilot/tools/manage_schedules.py+++ b/autogpt_platform/backend/backend/copilot/tools/manage_schedules.py@@ -255,6 +255,7 @@ class DeleteScheduleTool(BaseTool):"schedule_id": {"type": "string","description": "Schedule ID from list_schedules.",+ "entity": "schedule",},},"required": ["schedule_id"],@@ -355,6 +356,7 @@ class _ToggleScheduleTool(BaseTool):"schedule_id": {"type": "string","description": "Schedule ID from list_schedules.",+ "entity": "schedule",},},"required": ["schedule_id"],diff --git a/autogpt_platform/backend/backend/copilot/tools/message_session.py b/autogpt_platform/backend/backend/copilot/tools/message_session.pyindex bf95357696..aacbeabe1b 100644--- a/autogpt_platform/backend/backend/copilot/tools/message_session.py+++ b/autogpt_platform/backend/backend/copilot/tools/message_session.py@@ -73,6 +73,8 @@ class MessageSessionTool(BaseTool):"session_id": {"type": "string","description": "Target session id, from find_session.",+ "title": "Chat",+ "entity": "chat_session",},"message": {"type": "string",diff --git a/autogpt_platform/backend/backend/copilot/tools/routines.py b/autogpt_platform/backend/backend/copilot/tools/routines.pyindex dd10e32f23..c156bafbf7 100644--- a/autogpt_platform/backend/backend/copilot/tools/routines.py+++ b/autogpt_platform/backend/backend/copilot/tools/routines.py@@ -52,6 +52,7 @@ _EXPERT_ID_PARAM = {"Whose standing work. Experts act on themselves and omit it. From ""personal AutoPilot, name an expert, or omit for the account's own."),+ "entity": "expert",}@@ -152,6 +153,7 @@ class ScheduleRoutineTool(BaseTool):"Routine id from list_routines. Omit to create a new ""one from 'title' and 'prompt'."),+ "entity": "routine",},"title": {"type": "string",@@ -171,6 +173,7 @@ class ScheduleRoutineTool(BaseTool):"proposal with the user's answers. Required when it ""has unanswered 'asks'."),+ "title": "Instructions",},"crons": {"type": "array",@@ -182,6 +185,8 @@ class ScheduleRoutineTool(BaseTool):"gave an hour rather than a time, so routines do not ""pile up. Not with 'delay_seconds'."),+ "title": "Repeats",+ "format": "cron",},"delay_seconds": {"type": "integer",@@ -190,6 +195,8 @@ class ScheduleRoutineTool(BaseTool):"One-off work: seconds from now. Convert an absolute ""time ('at six') to a delay. Not with 'crons'."),+ "title": "Runs in",+ "format": "seconds",},"session_mode": {"type": "string",@@ -201,6 +208,7 @@ class ScheduleRoutineTool(BaseTool):"one unless 'session_id' names another. FRESH: a new ""chat each time, remembering nothing."),+ "title": "Where runs land",},"session_id": {"type": "string",@@ -209,6 +217,8 @@ class ScheduleRoutineTool(BaseTool):"this one; its id is in <session_context>. Same user ""and same expert only."),+ "title": "Lands in",+ "entity": "chat_session",},"grants_credentials": {"type": "boolean",@@ -218,6 +228,7 @@ class ScheduleRoutineTool(BaseTool):"touches nothing outside the platform. True only when ""the user agreed to THIS routine using their accounts."),+ "title": "Uses your accounts",},"integrations": INTEGRATIONS_PARAM,"expert_id": _EXPERT_ID_PARAM,diff --git a/autogpt_platform/backend/backend/copilot/tools/run_agent.py b/autogpt_platform/backend/backend/copilot/tools/run_agent.pyindex 6a43642b24..e551f214ff 100644--- a/autogpt_platform/backend/backend/copilot/tools/run_agent.py+++ b/autogpt_platform/backend/backend/copilot/tools/run_agent.py@@ -254,10 +254,12 @@ class RunAgentTool(BaseTool):"username_agent_slug": {"type": "string","description": "Marketplace format 'username/agent-name'.",+ "title": "Marketplace agent",},"library_agent_id": {"type": "string","description": "Library agent ID or graph ID from your library.",+ "entity": "agent_or_graph",},"preset_id": {"type": "string",@@ -266,6 +268,7 @@ class RunAgentTool(BaseTool):"credentials; 'inputs' override individual fields). Use ""alone — not with an agent identifier or save_as_preset."),+ "entity": "preset",},"inputs": {"type": "object",@@ -275,14 +278,18 @@ class RunAgentTool(BaseTool):"use_defaults": {"type": "boolean","description": "Run with default values (confirm with user first).",+ "title": "Uses default inputs",},"schedule_name": {"type": "string","description": "Name for scheduled execution. Providing this triggers scheduling mode (also requires cron).",+ "title": "Schedule",},"cron": {"type": "string","description": "Cron expression (min hour day month weekday).",+ "title": "Repeats",+ "format": "cron",},"timezone": {"type": "string",@@ -299,6 +306,8 @@ class RunAgentTool(BaseTool):),"minimum": 0,"maximum": MAX_TOOL_WAIT_SECONDS,+ "title": "Waits up to",+ "format": "seconds",},"dry_run": {"type": "boolean",diff --git a/autogpt_platform/backend/backend/copilot/tools/run_capability.py b/autogpt_platform/backend/backend/copilot/tools/run_capability.pyindex 7b0db122c4..f894b4eef6 100644--- a/autogpt_platform/backend/backend/copilot/tools/run_capability.py+++ b/autogpt_platform/backend/backend/copilot/tools/run_capability.py@@ -87,6 +87,7 @@ class RunCapabilityTool(BaseTool):"id": {"type": "string","description": "Capability id from find_capability, or an MCP server URL.",+ "entity": None,},"input": {"type": "object",@@ -317,7 +318,7 @@ async def _describe_tool(return CapabilityDetailsResponse(message=f"{tool.description} Call again without validate_only to run.",capability=entry.listing(),- parameters=tool.parameters,+ parameters=tool.model_parameters,session_id=session.session_id,).from_outside()diff --git a/autogpt_platform/backend/backend/copilot/tools/run_sub_session.py b/autogpt_platform/backend/backend/copilot/tools/run_sub_session.pyindex cac6d3e582..f6d41da80d 100644--- a/autogpt_platform/backend/backend/copilot/tools/run_sub_session.py+++ b/autogpt_platform/backend/backend/copilot/tools/run_sub_session.py@@ -98,11 +98,13 @@ class RunSubSessionTool(BaseTool):"prompt": {"type": "string","description": "The task for the child session to execute.",+ "title": "Task",},"system_context": {"type": "string","description": "Optional context prepended to the prompt.","default": "",+ "title": "Background",},"sub_autopilot_session_id": {"type": "string",@@ -111,6 +113,8 @@ class RunSubSessionTool(BaseTool):"Cheaper when the follow-up builds on what it read."),"default": "",+ "title": "Continues",+ "entity": "chat_session",},"wait_for_result": {"type": "integer",@@ -119,6 +123,8 @@ class RunSubSessionTool(BaseTool):f"Clamped to {MAX_SUB_SESSION_WAIT_SECONDS}."),"default": 60,+ "title": "Waits up to",+ "format": "seconds",},},"required": ["prompt"],diff --git a/autogpt_platform/backend/backend/copilot/tools/schedule_followup.py b/autogpt_platform/backend/backend/copilot/tools/schedule_followup.pyindex a641d097f6..d90cb1226d 100644--- a/autogpt_platform/backend/backend/copilot/tools/schedule_followup.py+++ b/autogpt_platform/backend/backend/copilot/tools/schedule_followup.py@@ -123,6 +123,8 @@ class ScheduleFollowupTool(BaseTool):"Mutually exclusive with cron."),"minimum": 60,+ "title": "Runs in",+ "format": "seconds",},"cron": {"type": "string",@@ -132,6 +134,8 @@ class ScheduleFollowupTool(BaseTool):"(e.g. '0 9 * * 1' = Mondays at 9am). Mutually ""exclusive with delay_seconds."),+ "title": "Repeats",+ "format": "cron",},"session_id": {"anyOf": [{"type": "string"}, {"type": "null"}],@@ -149,6 +153,8 @@ class ScheduleFollowupTool(BaseTool):"or in a different expert scope are rejected as ""'session_not_found'."),+ "title": "Lands in",+ "entity": "chat_session",},"name": {"type": "string",diff --git a/autogpt_platform/backend/backend/copilot/tools/setup_agent_webhook_trigger.py b/autogpt_platform/backend/backend/copilot/tools/setup_agent_webhook_trigger.pyindex aff260f577..854bfbbba7 100644--- a/autogpt_platform/backend/backend/copilot/tools/setup_agent_webhook_trigger.py+++ b/autogpt_platform/backend/backend/copilot/tools/setup_agent_webhook_trigger.py@@ -122,14 +122,18 @@ class SetupAgentWebhookTriggerTool(BaseTool):"library_agent_id": {"type": "string","description": "Library agent ID (preferred identifier).",+ "entity": "library_agent",},"graph_id": {"type": "string","description": "Agent graph ID (alt to library_agent_id).",+ "title": "Agent",+ "entity": "graph",},"graph_version": {"type": "integer","description": "Graph version (used with graph_id).",+ "title": "Agent version",},"name": {"type": "string",@@ -148,6 +152,7 @@ class SetupAgentWebhookTriggerTool(BaseTool):"the trigger node. Usually empty for generic webhooks."),"additionalProperties": True,+ "title": "Trigger settings",},"credentials": {"type": "object",diff --git a/autogpt_platform/backend/backend/copilot/tools/skills.py b/autogpt_platform/backend/backend/copilot/tools/skills.pyindex 46d22f7776..372cf5817c 100644--- a/autogpt_platform/backend/backend/copilot/tools/skills.py+++ b/autogpt_platform/backend/backend/copilot/tools/skills.py@@ -2447,6 +2447,7 @@ async def build_skills_update_notice(_EXPERT_ID_PARAM = {"type": "string","description": "Manage this expert's skills (Otto only).",+ "entity": "expert",}diff --git a/autogpt_platform/backend/backend/copilot/tools/update_expert.py b/autogpt_platform/backend/backend/copilot/tools/update_expert.pyindex 1644a1e44e..735f37ae6b 100644--- a/autogpt_platform/backend/backend/copilot/tools/update_expert.py+++ b/autogpt_platform/backend/backend/copilot/tools/update_expert.py@@ -69,6 +69,7 @@ class UpdateExpertTool(BaseTool):"expert_id": {"type": "string","description": "The team expert to edit.",+ "entity": "expert",},"name": {"type": "string",diff --git a/autogpt_platform/backend/backend/copilot/tools/update_soul.py b/autogpt_platform/backend/backend/copilot/tools/update_soul.pyindex a2173b813a..86c3c30ab0 100644--- a/autogpt_platform/backend/backend/copilot/tools/update_soul.py+++ b/autogpt_platform/backend/backend/copilot/tools/update_soul.py@@ -221,6 +221,7 @@ class ConfirmExpertSoulUpdateTool(BaseTool):"confirmation_id": {"type": "string","description": "The confirmation_id returned by update_expert_soul.",+ "entity": "soul_change",},},"required": ["confirmation_id"],diff --git a/autogpt_platform/backend/backend/copilot/tools/workspace_files.py b/autogpt_platform/backend/backend/copilot/tools/workspace_files.pyindex b00040831a..0d30401442 100644--- a/autogpt_platform/backend/backend/copilot/tools/workspace_files.py+++ b/autogpt_platform/backend/backend/copilot/tools/workspace_files.py@@ -1088,6 +1088,7 @@ class DeleteWorkspaceFileTool(BaseTool):"file_id": {"type": "string","description": "File ID from list_workspace_files.",+ "entity": "workspace_file",},"path": {"type": "string",diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/ApprovalQueue.stories.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/ApprovalQueue.stories.tsxindex 827886a3ee..9b78e15e38 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/ApprovalQueue.stories.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/ApprovalQueue.stories.tsx@@ -199,6 +199,18 @@ export const UnresolvedId: Story = {args: queueOf([referenceCard("Unresolved id")]),};+export const FollowUpInTwoDays: Story = {+ args: queueOf([referenceCard("Follow-up in two days")]),+};++export const WeeklyFollowUp: Story = {+ args: queueOf([referenceCard("Weekly follow-up")]),+};++export const DelegateAndWait: Story = {+ args: queueOf([referenceCard("Delegate and wait")]),+};+export const FiveWaiting: Story = {args: queueOf([heldReview({diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/realCards.json b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/realCards.jsonindex 80f83e0f91..566426c1db 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/realCards.json+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/realCards.json@@ -21,19 +21,23 @@"fields": [{"key": "to",- "label": "To"+ "label": "To",+ "format": null},{"key": "cc",- "label": "Cc"+ "label": "Cc",+ "format": null},{"key": "subject",- "label": "Subject"+ "label": "Subject",+ "format": null},{"key": "body",- "label": "Body"+ "label": "Body",+ "format": null}],"references": [],@@ -207,19 +211,23 @@"fields": [{"key": "spreadsheet",- "label": "Spreadsheet"+ "label": "Spreadsheet",+ "format": null},{"key": "sheet_name",- "label": "Sheet name"+ "label": "Sheet name",+ "format": null},{"key": "row_index",- "label": "Row index"+ "label": "Row index",+ "format": null},{"key": "values",- "label": "Values"+ "label": "Values",+ "format": null}],"references": [],@@ -431,15 +439,18 @@"fields": [{"key": "sandbox_id",- "label": "Sandbox"+ "label": "Sandbox",+ "format": null},{"key": "language",- "label": "Language"+ "label": "Language",+ "format": null},{"key": "step_code",- "label": "Step code"+ "label": "Step code",+ "format": null}],"references": [],@@ -576,19 +587,23 @@"fields": [{"key": "url",- "label": "Url"+ "label": "Url",+ "format": null},{"key": "method",- "label": "Method"+ "label": "Method",+ "format": null},{"key": "headers",- "label": "Headers"+ "label": "Headers",+ "format": null},{"key": "body",- "label": "Body"+ "label": "Body",+ "format": null}],"references": [],@@ -719,19 +734,23 @@"fields": [{"key": "post",- "label": "Post"+ "label": "Post",+ "format": null},{"key": "media_urls",- "label": "Media urls"+ "label": "Media urls",+ "format": null},{"key": "alt_text",- "label": "Alt text"+ "label": "Alt text",+ "format": null},{"key": "shorten_links",- "label": "Shorten links"+ "label": "Shorten links",+ "format": null}],"references": [],@@ -1069,15 +1088,18 @@"fields": [{"key": "to",- "label": "To"+ "label": "To",+ "format": null},{"key": "subject",- "label": "Subject"+ "label": "Subject",+ "format": null},{"key": "body",- "label": "Body"+ "label": "Body",+ "format": null}],"references": [],@@ -1246,11 +1268,13 @@"fields": [{"key": "library_agent_id",- "label": "Library agent"+ "label": "Library agent",+ "format": null},{"key": "inputs",- "label": "Inputs"+ "label": "Inputs",+ "format": null}],"references": [],@@ -1303,11 +1327,13 @@"fields": [{"key": "command",- "label": "Command"+ "label": "Command",+ "format": null},{"key": "timeout",- "label": "Timeout"+ "label": "Time limit",+ "format": "seconds"}],"references": [],diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/referenceCards.json b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/referenceCards.jsonindex 26387a8a6f..24444035e3 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/referenceCards.json+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/referenceCards.json@@ -18,7 +18,8 @@"fields": [{"key": "folder_id",- "label": "Folder"+ "label": "Folder",+ "format": null}],"references": [@@ -114,41 +115,16 @@"fields": [{"key": "agent_ids",- "label": "Agents"+ "label": "Agents",+ "format": null},{"key": "folder_id",- "label": "Folder"+ "label": "Folder",+ "format": null}],"references": [- {- "key": "folder_id",- "entity": "library_folder",- "id": "f-archive",- "name": "Archive",- "href": "/library?folder=f-archive",- "kind": "Library folder",- "description": null,- "meta": [- {- "text": "4 agents",- "cron": null,- "label": null,- "at": null- },- {- "text": "1 subfolder",- "cron": null,- "label": null,- "at": null- }- ],- "avatar_url": null,- "avatar_color": null,- "skills": [],- "summary": "4 agents · 1 subfolder"- },{"key": "agent_ids","entity": "library_agent",@@ -294,11 +270,38 @@"avatar_color": null,"skills": [],"summary": "Version 3 · In Mornings · Never run"+ },+ {+ "key": "folder_id",+ "entity": "library_folder",+ "id": "f-archive",+ "name": "Archive",+ "href": "/library?folder=f-archive",+ "kind": "Library folder",+ "description": null,+ "meta": [+ {+ "text": "4 agents",+ "cron": null,+ "label": null,+ "at": null+ },+ {+ "text": "1 subfolder",+ "cron": null,+ "label": null,+ "at": null+ }+ ],+ "avatar_url": null,+ "avatar_color": null,+ "skills": [],+ "summary": "4 agents · 1 subfolder"}],"reference_totals": {- "folder_id": 1,- "agent_ids": 7+ "agent_ids": 7,+ "folder_id": 1},"tool_call_id": "call-move_agents_to_folder","turn": 1,@@ -346,7 +349,8 @@"fields": [{"key": "schedule_id",- "label": "Schedule"+ "label": "Schedule",+ "format": null}],"references": [@@ -434,11 +438,13 @@"fields": [{"key": "template_id",- "label": "Template"+ "label": "Template",+ "format": null},{"key": "name",- "label": "Name"+ "label": "Name",+ "format": null}],"references": [@@ -519,11 +525,13 @@"fields": [{"key": "session_id",- "label": "Session"+ "label": "Chat",+ "format": null},{"key": "message",- "label": "Message"+ "label": "Message",+ "format": null}],"references": [@@ -605,14 +613,37 @@"fields": [{"key": "expert_id",- "label": "Expert"+ "label": "Expert",+ "format": null},{"key": "credential_id",- "label": "Credential"+ "label": "Credential",+ "format": null}],"references": [+ {+ "key": "expert_id",+ "entity": "expert",+ "id": "exp-ada",+ "name": "Ada",+ "href": "/team/exp-ada",+ "kind": "Expert",+ "description": null,+ "meta": [+ {+ "text": "Bookkeeper",+ "cron": null,+ "label": null,+ "at": null+ }+ ],+ "avatar_url": null,+ "avatar_color": "#0ea5e9",+ "skills": [],+ "summary": "Bookkeeper"+ },{"key": "credential_id","entity": "credential",@@ -639,27 +670,6 @@"avatar_color": null,"skills": [],"summary": "github · api key"- },- {- "key": "expert_id",- "entity": "expert",- "id": "exp-ada",- "name": "Ada",- "href": "/team/exp-ada",- "kind": "Expert",- "description": null,- "meta": [- {- "text": "Bookkeeper",- "cron": null,- "label": null,- "at": null- }- ],- "avatar_url": null,- "avatar_color": "#0ea5e9",- "skills": [],- "summary": "Bookkeeper"}],"reference_totals": {@@ -712,7 +722,8 @@"fields": [{"key": "agent_id",- "label": "Agent"+ "label": "Agent",+ "format": null}],"references": [@@ -799,7 +810,8 @@"fields": [{"key": "preset_id",- "label": "Preset"+ "label": "Preset",+ "format": null}],"references": [@@ -874,7 +886,8 @@"fields": [{"key": "preset_id",- "label": "Preset"+ "label": "Preset",+ "format": null}],"references": [@@ -949,7 +962,8 @@"fields": [{"key": "routine_id",- "label": "Routine"+ "label": "Routine",+ "format": null}],"references": [@@ -1025,11 +1039,13 @@"fields": [{"key": "store_listing_version_id",- "label": "Store listing version"+ "label": "Marketplace agent",+ "format": null},{"key": "expert_id",- "label": "Expert"+ "label": "Expert",+ "format": null}],"references": [@@ -1089,8 +1105,8 @@}],"reference_totals": {- "expert_id": 1,- "store_listing_version_id": 1+ "store_listing_version_id": 1,+ "expert_id": 1},"tool_call_id": "call-install_expert_workflow","turn": 1,@@ -1138,7 +1154,8 @@"fields": [{"key": "workflow_id",- "label": "Workflow"+ "label": "Workflow",+ "format": null}],"references": [@@ -1206,7 +1223,8 @@"fields": [{"key": "confirmation_id",- "label": "Confirmation"+ "label": "Confirmation",+ "format": null}],"references": [@@ -1288,11 +1306,13 @@"fields": [{"key": "file_id",- "label": "File"+ "label": "File",+ "format": null},{"key": "path",- "label": "Path"+ "label": "Path",+ "format": null}],"references": [@@ -1385,7 +1405,8 @@"fields": [{"key": "preset_id",- "label": "Preset"+ "label": "Preset",+ "format": null}],"references": [@@ -1433,5 +1454,245 @@"editable": false,"status": "WAITING"}+ },+ {+ "story": "Follow-up in two days",+ "review": {+ "node_exec_id": "copilot-node-gate-schedule_followup:7552e2303308fb3d",+ "node_id": "copilot-node-gate-schedule_followup",+ "user_id": "user-1",+ "session_id": "s1",+ "graph_exec_id": null,+ "graph_id": null,+ "graph_version": null,+ "payload": {+ "tool": "schedule_followup",+ "arguments": {+ "message": "Check that Ada finished the partner dossiers.",+ "delay_seconds": 183420,+ "session_id": "s-q3"+ },+ "clipped": [],+ "fields": [+ {+ "key": "message",+ "label": "Message",+ "format": null+ },+ {+ "key": "delay_seconds",+ "label": "Runs in",+ "format": "seconds"+ },+ {+ "key": "session_id",+ "label": "Lands in",+ "format": null+ }+ ],+ "references": [+ {+ "key": "session_id",+ "entity": "chat_session",+ "id": "s-q3",+ "name": "Q3 planning",+ "href": "/copilot?sessionId=s-q3",+ "kind": "Chat",+ "description": null,+ "meta": [+ {+ "text": "Started 2026-09-24",+ "cron": null,+ "label": "Started",+ "at": "2026-09-24T14:05:00+00:00"+ },+ {+ "text": "Last active 2026-09-24",+ "cron": null,+ "label": "Last active",+ "at": "2026-09-24T14:05:00+00:00"+ }+ ],+ "avatar_url": null,+ "avatar_color": null,+ "skills": [],+ "summary": "Started 2026-09-24 · Last active 2026-09-24"+ }+ ],+ "reference_totals": {+ "session_id": 1+ },+ "tool_call_id": "call-schedule_followup",+ "turn": 1,+ "mode": "ask_first",+ "subject": {+ "kind": "tool",+ "key": "schedule_followup",+ "name": "Schedule a follow-up",+ "effect": "platform",+ "irreversible": false,+ "block_id": null+ },+ "reason": "Ask First is on for this chat, so this action needs your approval.",+ "reason_kind": "mode",+ "decided_by": null,+ "chat_rules_allowed": ["allow", "judge"],+ "headline": {+ "ask": "Schedule a follow-up",+ "object": null,+ "object_key": null+ },+ "spend": null+ },+ "instructions": "schedule_followup",+ "editable": false,+ "status": "WAITING"+ }+ },+ {+ "story": "Weekly follow-up",+ "review": {+ "node_exec_id": "copilot-node-gate-schedule_followup:f9f30c88b7447210",+ "node_id": "copilot-node-gate-schedule_followup",+ "user_id": "user-1",+ "session_id": "s1",+ "graph_exec_id": null,+ "graph_id": null,+ "graph_version": null,+ "payload": {+ "tool": "schedule_followup",+ "arguments": {+ "message": "Review the sales pipeline.",+ "cron": "0 9 * * 1"+ },+ "clipped": [],+ "fields": [+ {+ "key": "message",+ "label": "Message",+ "format": null+ },+ {+ "key": "cron",+ "label": "Repeats",+ "format": "cron"+ }+ ],+ "references": [],+ "reference_totals": {},+ "tool_call_id": "call-schedule_followup",+ "turn": 1,+ "mode": "ask_first",+ "subject": {+ "kind": "tool",+ "key": "schedule_followup",+ "name": "Schedule a follow-up",+ "effect": "platform",+ "irreversible": false,+ "block_id": null+ },+ "reason": "Ask First is on for this chat, so this action needs your approval.",+ "reason_kind": "mode",+ "decided_by": null,+ "chat_rules_allowed": ["allow", "judge"],+ "headline": {+ "ask": "Schedule a follow-up",+ "object": null,+ "object_key": null+ },+ "spend": null+ },+ "instructions": "schedule_followup",+ "editable": false,+ "status": "WAITING"+ }+ },+ {+ "story": "Delegate and wait",+ "review": {+ "node_exec_id": "copilot-node-gate-delegate_to_expert:ca2d42d7eff7f9bf",+ "node_id": "copilot-node-gate-delegate_to_expert",+ "user_id": "user-1",+ "session_id": "s1",+ "graph_exec_id": null,+ "graph_id": null,+ "graph_version": null,+ "payload": {+ "tool": "delegate_to_expert",+ "arguments": {+ "expert_id": "exp-ada",+ "prompt": "Backfill the partner dossiers for the three new accounts.",+ "wait_for_result": 180+ },+ "clipped": [],+ "fields": [+ {+ "key": "expert_id",+ "label": "Expert",+ "format": null+ },+ {+ "key": "prompt",+ "label": "Task",+ "format": null+ },+ {+ "key": "wait_for_result",+ "label": "Waits up to",+ "format": "seconds"+ }+ ],+ "references": [+ {+ "key": "expert_id",+ "entity": "expert_or_name",+ "id": "exp-ada",+ "name": "Ada",+ "href": "/team/exp-ada",+ "kind": "Expert",+ "description": null,+ "meta": [+ {+ "text": "Bookkeeper",+ "cron": null,+ "label": null,+ "at": null+ }+ ],+ "avatar_url": null,+ "avatar_color": "#0ea5e9",+ "skills": [],+ "summary": "Bookkeeper"+ }+ ],+ "reference_totals": {+ "expert_id": 1+ },+ "tool_call_id": "call-delegate_to_expert",+ "turn": 1,+ "mode": "ask_first",+ "subject": {+ "kind": "tool",+ "key": "delegate_to_expert",+ "name": "Hand a task to a teammate",+ "effect": "platform",+ "irreversible": false,+ "block_id": null+ },+ "reason": "Ask First is on for this chat, so this action needs your approval.",+ "reason_kind": "mode",+ "decided_by": null,+ "chat_rules_allowed": ["allow", "judge"],+ "headline": {+ "ask": "Hand a task to a teammate",+ "object": "Ada",+ "object_key": "expert_id"+ },+ "spend": null+ },+ "instructions": "delegate_to_expert",+ "editable": false,+ "status": "WAITING"+ }}]diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/references.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/references.test.tsxindex 86df5a796e..2d77491a9c 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/references.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/__tests__/references.test.tsx@@ -232,3 +232,19 @@ test("unresolved agent IDs stay listed beside a resolved folder headline", asyncexpect(view.getByText(/lib-lost-1/)).toBeDefined();expect(view.getByText(/lib-lost-2/)).toBeDefined();});++test.each([+ ["Follow-up in two days", "Runs in", "2 days 3 hours", "183420"],+ ["Weekly follow-up", "Repeats", "Every Monday at 09:00", "0 9 * * 1"],+ ["Delegate and wait", "Waits up to", "3 minutes", "180"],+])(+ "%s: the argument reads as its schema labels and words it",+ async (story, label, text, raw) => {+ renderCard(referenceCard(story));++ const view = await card();+ expect(view.getByText(label)).toBeDefined();+ expect(view.getByText(text)).toBeDefined();+ expect(view.queryByText(raw)).toBeNull();+ },+);diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/helpers.tsindex 95eb6d7d57..af9f021f6b 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ApprovalQueue/helpers.ts@@ -3,6 +3,7 @@ import { COPILOT_GATE_NODE_PREFIX } from "@/components/organisms/PendingReviewsLimport { AUTOPILOT_NAME } from "@/components/molecules/AutopilotAvatar/helpers";import {type Fact,+ type FieldSpec,isIdKey,type Reference,visibleKeys,@@ -36,7 +37,7 @@ export interface ApprovalItem {toolName: string;toolCallId: string;args: Record<string, unknown>;- fields: { key: string; label: string }[];+ fields: FieldSpec[];references: Reference[];// Ids per argument before the server clipped it.referenceTotals: Record<string, number>;@@ -87,6 +88,7 @@ export function toApprovalItem(review: PendingHumanReviewModel): ApprovalItem {.map((f) => ({key: String(f.key),label: str(f, "label") ?? String(f.key),+ format: str(f, "format"),})),references: asArray(payload.references).flatMap(toReference),referenceTotals: toTotals(payload.reference_totals),diff --git a/autogpt_platform/frontend/src/components/organisms/ApprovalFields/ApprovalFields.tsx b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/ApprovalFields.tsxindex cfd4cda0b1..a09853585b 100644--- a/autogpt_platform/frontend/src/components/organisms/ApprovalFields/ApprovalFields.tsx+++ b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/ApprovalFields.tsx@@ -37,14 +37,18 @@ export function ApprovalFields({referenceTotals = {},}: Props) {const [showAll, setShowAll] = useState(false);- const labels = new Map(fields.map((f) => [f.key, f.label]));+ const specs = new Map(fields.map((f) => [f.key, f]));const ordered = visibleKeys({keys: [...fields.map((f) => f.key), ...Object.keys(values)],values,hiddenKeys,idsWhenAlone,references,- }).map((key) => ({ key, label: labels.get(key) ?? humanize(key) }));+ }).map((key) => ({+ key,+ label: specs.get(key)?.label ?? humanize(key),+ format: specs.get(key)?.format,+ }));if (ordered.length === 0) return null;const shown = showAll ? ordered : ordered.slice(0, MAX_FIELDS);@@ -60,6 +64,7 @@ export function ApprovalFields({<FieldOrReferencename={field.key}value={values[field.key]}+ format={field.format}clipped={clipped.includes(field.key)}references={references}total={referenceTotals[field.key]}@@ -85,6 +90,7 @@ export function ApprovalFields({interface FieldOrReferenceProps {name: string;value: unknown;+ format?: string | null;clipped: boolean;references: Reference[];total?: number;@@ -93,13 +99,16 @@ interface FieldOrReferenceProps {function FieldOrReference({name,value,+ format,clipped,references,total,}: FieldOrReferenceProps) {const refs = references.filter((ref) => ref.key === name);if (!refs.some((ref) => ref.name))- return <FieldValue name={name} value={value} clipped={clipped} />;+ return (+ <FieldValue name={name} value={value} format={format} clipped={clipped} />+ );const counted = Array.isArray(value)? value.filter((v) => typeof v === "string" && v.trim()).length: refs.length;diff --git a/autogpt_platform/frontend/src/components/organisms/ApprovalFields/__tests__/ApprovalFields.test.tsx b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/__tests__/ApprovalFields.test.tsxnew file mode 100644index 0000000000..73f954bdcc--- /dev/null+++ b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/__tests__/ApprovalFields.test.tsx@@ -0,0 +1,29 @@+import { expect, test } from "vitest";+import { render, screen } from "@/tests/integrations/test-utils";+import { ApprovalFields } from "../ApprovalFields";++test.each([+ ["seconds", 59, "59 seconds"],+ ["seconds", 90, "1 minute 30 seconds"],+ ["seconds", 3_599, "59 minutes 59 seconds"],+ ["seconds", 5_400, "1 hour 30 minutes"],+ ["seconds", 86_400, "1 day"],+ [+ "cron",+ ["0 9 * * *", "0 17 * * *"],+ "Every day at 09:00, Every day at 17:00",+ ],+ // Anything the card cannot word shows as it did before hints existed.+ ["seconds", "soon", "soon"],+ ["cron", "at nine", "at nine"],+ ["date-time", "2026-10-02T09:00:00Z", "2026-10-02T09:00:00Z"],+ [null, 180, "180"],+])("format %s shows %j as %s", (format, value, text) => {+ render(+ <ApprovalFields+ fields={[{ key: "when", label: "When", format }]}+ values={{ when: value }}+ />,+ );+ expect(screen.getByText(text)).toBeDefined();+});diff --git a/autogpt_platform/frontend/src/components/organisms/ApprovalFields/components/FieldValue.tsx b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/components/FieldValue.tsxindex 7313736812..4289ed994d 100644--- a/autogpt_platform/frontend/src/components/organisms/ApprovalFields/components/FieldValue.tsx+++ b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/components/FieldValue.tsx@@ -7,6 +7,7 @@ import {CLAMP_LINES,CODE_MAX_LINES,fieldKind,+ formattedText,humanize,lineCount,listText,@@ -18,13 +19,16 @@ interface Props {name: string;value: unknown;clipped: boolean;+ format?: string | null;}-export function FieldValue({ name, value, clipped }: Props) {+export function FieldValue({ name, value, clipped, format }: Props) {const kind = fieldKind(name, value);const shortened = clipped ? (<span className="ml-1 text-zinc-400">(shortened)</span>) : null;+ const formatted = formattedText(format, value);+ if (formatted) return <span>{formatted}</span>;switch (kind) {case "secret":diff --git a/autogpt_platform/frontend/src/components/organisms/ApprovalFields/helpers.ts b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/helpers.tsindex 3b3a7c25a4..fb7cc083a8 100644--- a/autogpt_platform/frontend/src/components/organisms/ApprovalFields/helpers.ts+++ b/autogpt_platform/frontend/src/components/organisms/ApprovalFields/helpers.ts@@ -24,6 +24,8 @@ export type FieldKind =export interface FieldSpec {key: string;label: string;+ // How the value is worded, from the tool's schema; anything else shows as is.+ format?: string | null;}// What an id argument names, resolved by the server when the call was held.@@ -69,6 +71,45 @@ function cronText(cron: string) {}}+export function formattedText(+ format: string | null | undefined,+ value: unknown,+) {+ if (format === "seconds" && typeof value === "number" && value >= 0)+ return durationText(value);+ if (format !== "cron") return null;+ const crons = Array.isArray(value) ? value : [value];+ const texts = crons.map((cron) =>+ typeof cron === "string" ? cronText(cron) : null,+ );+ return texts.every(Boolean) ? listText(texts) : null;+}++const UNITS = [+ ["day", 86_400],+ ["hour", 3_600],+ ["minute", 60],+ ["second", 1],+] as const;++// The two largest units, the smaller one rounded: 183420 is "2 days 3 hours".+function durationText(seconds: number) {+ const at = UNITS.findIndex(([, size]) => seconds >= size);+ if (at === -1 || at === UNITS.length - 1)+ return unitText(Math.round(seconds), "second");+ const [big, bigSize] = UNITS[at];+ const [small, smallSize] = UNITS[at + 1];+ const total = Math.round(seconds / smallSize);+ const perBig = bigSize / smallSize;+ const rest = total % perBig;+ const head = unitText(Math.floor(total / perBig), big);+ return rest ? `${head} ${unitText(rest, small)}` : head;+}++function unitText(count: number, unit: string) {+ return `${count} ${unit}${count === 1 ? "" : "s"}`;+}+export function fieldKind(key: string, value: unknown): FieldKind {if (value === REDACTED) return "secret";if (Array.isArray(value)) {