$npx -y skills add agentscope-ai/QwenPaw --skill chat_with_agent-enUse this skill when you need to consult another agent, ask for help, or involve a specific agent the user asked for.
| 1 | # Chat with Agent |
| 2 | |
| 3 | ## When to Use |
| 4 | |
| 5 | Use this skill when you need to **ask another agent a question, seek help, request a plan, request a review, request decision support, or engage in any form of communication**. |
| 6 | If the **user explicitly asks to talk to a specific agent**, you should also use this skill. |
| 7 | |
| 8 | ### Should Use |
| 9 | |
| 10 | - You need another agent's expertise, judgment, or second opinion |
| 11 | - You need to request a plan, review, or recommendation from an agent |
| 12 | - The user explicitly asks a specific agent to participate, assist, or answer |
| 13 | - You need to continue an existing agent session while preserving context |
| 14 | |
| 15 | ### Should Not Use |
| 16 | |
| 17 | - You can complete the task yourself and the user has not explicitly asked to involve another agent |
| 18 | - It is a simple Q&A that does not require a specialized agent |
| 19 | - The target agent is unclear — you should ask for clarification or list available agents first |
| 20 | - You just received a message from an agent and are about to immediately call back the same agent, which may cause a loop |
| 21 | |
| 22 | ## Decision Rules |
| 23 | |
| 24 | 1. **If the user explicitly requests a specific agent, follow that request — but still look up the agent first; do not guess the ID** |
| 25 | 2. **If you can complete the task yourself, do not call another agent** |
| 26 | 3. **When continuing a conversation, you must pass `session_id`** |
| 27 | 4. **By default, prefer using `list_agents()` and `chat_with_agent(...)` for foreground conversations — do not resort to other methods** |
| 28 | 5. **If the task should run in the background, use `submit_to_agent(...)` to submit it, then `check_agent_task(...)` to check the status** |
| 29 | |
| 30 | ## Usage Flow |
| 31 | |
| 32 | Follow this flow strictly when using this skill: |
| 33 | |
| 34 | 1) Ensure your tool list includes both `list_agents()` and `chat_with_agent(...)` built-in tools |
| 35 | |
| 36 | - These two tools are the foundation for communicating with other agents — do not remove or disable them |
| 37 | - If you do not have these tools, inform the user that you need them to talk to other agents, and ask the user to add them |
| 38 | |
| 39 | 2) Use `list_agents()` to view the currently available agents, and select one by extracting its ID |
| 40 | |
| 41 | - Choose the most appropriate agent based on the user's needs and each agent's description |
| 42 | - If no suitable agent is found and you are not the Default Agent, use the Default Agent |
| 43 | - Otherwise, inform the user that no suitable agent is available, and suggest they create a new agent or adjust existing agent descriptions for better matching |
| 44 | |
| 45 | 3) Call `chat_with_agent(...)` to initiate a foreground conversation. Key parameters include: |
| 46 | - `to_agent`: the target agent's ID (note: this is the ID, not the name) |
| 47 | - `text`: what you want to say to the target agent |
| 48 | - `session_id`: (optional) if you need multiple rounds of conversation with the same agent, pass the same `session_id` starting from the second round to maintain context continuity |
| 49 | - `timeout`: (optional) estimated time needed for the foreground wait, to avoid premature timeouts |
| 50 | |
| 51 | 4) If the task is better suited for background execution, use the background tool path: |
| 52 | - `submit_to_agent(...)`: submit a background task — only requires `to_agent`, `text`, and optionally `session_id` |
| 53 | - `check_agent_task(...)`: check task status by `task_id`; returns the final result when complete |
| 54 | |
| 55 | ## Minimal Call Examples |
| 56 | |
| 57 | ### New Conversation |
| 58 | |
| 59 | ```text |
| 60 | list_agents() |
| 61 | |
| 62 | chat_with_agent( |
| 63 | to_agent="<target_agent_id>", |
| 64 | text="[Agent <your_agent_id> requesting] I need your help determining the approach for this issue.", |
| 65 | ) |
| 66 | ``` |
| 67 | |
| 68 | ### Continuing an Existing Conversation |
| 69 | |
| 70 | ```text |
| 71 | chat_with_agent( |
| 72 | to_agent="<target_agent_id>", |
| 73 | text="[Agent <your_agent_id> requesting] Please continue expanding on point 2 based on the previous conclusion.", |
| 74 | session_id="<previous_session_id>", |
| 75 | ) |
| 76 | ``` |
| 77 | |
| 78 | ### Background Submission and Status Check |
| 79 | |
| 80 | ```text |
| 81 | submit_to_agent( |
| 82 | to_agent="<target_agent_id>", |
| 83 | text="[Agent <your_agent_id> requesting] Please complete this longer task in the background.", |
| 84 | ) |
| 85 | |
| 86 | check_agent_task( |
| 87 | task_id="<task_id>", |
| 88 | ) |
| 89 | ``` |
| 90 | |
| 91 | |
| 92 | ## Important Notes |
| 93 | |
| 94 | - **Add a conversation identifier**: it is recommended to start your message with: |
| 95 | |
| 96 | ```text |
| 97 | [Agent <your_agent_id> requesting] |
| 98 | ``` |
| 99 | This helps the other agent clearly identify who is speaking, improving communication efficiency and accuracy. |
| 100 | |
| 101 | |
| 102 | - **Reuse sessions wisely**: if you need multiple rounds of conversation with the same agent, be sure to pass the same `session_id` to maintain context continuity. Otherwise, each call is treated as a new conversation, and the other agent may not correctly understand your needs. You can obtain the `session_id` from the first round's response, for example: |
| 103 | |
| 104 | ```text |
| 105 | [SESSION: xxx] |
| 106 | ``` |
| 107 | |
| 108 | where `xxx` is the `session_id` value. This value is typically system-generated and has a long, unique format. Save this `session_id` and |