Merge remote-tracking branch 'origin/ji' into ji
This commit is contained in:
commit
aeef1dca59
2 files changed
+6
-2
No files matched your search
+4
@@ -67,6 +67,10 @@ class SetupAgentApprovalMiddleware(AgentMiddleware[SetupAgentApprovalMiddlewareS
|
|||||||
|
|
||||||
args = setup_call.get("args") or {}
|
args = setup_call.get("args") or {}
|
||||||
tool_call_id = setup_call.get("id") or ""
|
tool_call_id = setup_call.get("id") or ""
|
||||||
|
|
||||||
|
if isinstance(args.get("skills"), list) and len(args["skills"]) > 5:
|
||||||
|
args = {**args, "skills": args["skills"][:5]}
|
||||||
|
|
||||||
payload = self._build_payload(args)
|
payload = self._build_payload(args)
|
||||||
logger.info("Setup agent approval requested before writing agent files")
|
logger.info("Setup agent approval requested before writing agent files")
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ def setup_agent(
|
|||||||
description: One-line description of what the agent does.
|
description: One-line description of what the agent does.
|
||||||
name: Optional human-readable display name for the agent. If omitted,
|
name: Optional human-readable display name for the agent. If omitted,
|
||||||
the agent's stable id is used as the display name.
|
the agent's stable id is used as the display name.
|
||||||
skills: Optional list of skill names this agent should use. None or empty means no skills.
|
skills: Optional list of skill names this agent should use. None or empty means no skills. Maximum 5 skills allowed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
agent_name: str | None = (runtime.context.get("agent_id") or runtime.context.get("agent_name")) if runtime.context else None
|
agent_name: str | None = (runtime.context.get("agent_id") or runtime.context.get("agent_name")) if runtime.context else None
|
||||||
@@ -48,7 +48,7 @@ def setup_agent(
|
|||||||
if description:
|
if description:
|
||||||
config_data["description"] = description
|
config_data["description"] = description
|
||||||
if skills is not None:
|
if skills is not None:
|
||||||
config_data["skills"] = skills
|
config_data["skills"] = skills[:5]
|
||||||
|
|
||||||
config_file = agent_dir / "config.yaml"
|
config_file = agent_dir / "config.yaml"
|
||||||
with open(config_file, "w", encoding="utf-8") as f:
|
with open(config_file, "w", encoding="utf-8") as f:
|
||||||
|
|||||||
Reference in new issue
Block a user