fix: Prevent agents page from scrolling — lock layout to viewport
Body: height 100vh + overflow hidden instead of min-height 100vh, so the browser never shows a scrollbar on html/body. AppLayout: h-screen flex column with shrink-0 header and flex-1 min-h-0 overflow-auto main. Pages like initiatives scroll within main; agents page uses h-full with internal panel scrollers.
This commit is contained in:
@@ -47,53 +47,80 @@ Use the output as the filename (e.g., \`{id}.md\`).`;
|
||||
export const INTER_AGENT_COMMUNICATION = `
|
||||
## Inter-Agent Communication
|
||||
|
||||
You are working in a multi-agent parallel environment. Other agents may be working on related tasks simultaneously.
|
||||
You are working in a multi-agent parallel environment. Other agents may be working on related tasks simultaneously. You can exchange questions and answers with peer agents via CLI commands.
|
||||
|
||||
### Your Identity
|
||||
Read \`.cw/input/manifest.json\` — it contains \`agentId\` and \`agentName\` fields identifying you.
|
||||
Read \`.cw/input/manifest.json\` — it contains \`agentId\` and \`agentName\` fields identifying you. You'll need your \`agentId\` for all communication commands.
|
||||
|
||||
### Listening for Questions
|
||||
At the START of your session, start a background listener:
|
||||
### CLI Commands
|
||||
|
||||
**\`cw listen\`** — Poll for incoming questions. Prints the first pending question as JSON and exits.
|
||||
\`\`\`
|
||||
cw listen --agent-id <YOUR_AGENT_ID> [--timeout <ms>] [--poll-interval <ms>]
|
||||
\`\`\`
|
||||
- \`--agent-id\` (required): Your agent ID
|
||||
- \`--timeout\`: Max wait in ms. Default: 0 (wait forever). Use a value like 120000 (2 min) to avoid hanging.
|
||||
- \`--poll-interval\`: Polling frequency in ms. Default: 2000
|
||||
- Output (JSON): \`{ "conversationId": "...", "fromAgentId": "...", "question": "...", "phaseId": "...", "taskId": "..." }\`
|
||||
- Exit code 0 if a question was found, 1 on timeout or error.
|
||||
|
||||
**\`cw ask\`** — Ask another agent a question. Blocks until the answer arrives, then prints the answer text to stdout.
|
||||
\`\`\`
|
||||
cw ask "<question>" --from <YOUR_AGENT_ID> --agent-id <TARGET_AGENT_ID> [--timeout <ms>] [--poll-interval <ms>]
|
||||
\`\`\`
|
||||
- \`--from\` (required): Your agent ID (the asker)
|
||||
- Target (exactly one required):
|
||||
- \`--agent-id <id>\`: Ask a specific agent directly
|
||||
- \`--task-id <id>\`: Ask whichever agent is running that task
|
||||
- \`--phase-id <id>\`: Ask whichever agent is running a task in that phase
|
||||
- \`--timeout\`: Max wait in ms. Default: 0 (wait forever). Use 120000+ for safety.
|
||||
- \`--poll-interval\`: Polling frequency in ms. Default: 2000
|
||||
- Output: The answer text (plain text, not JSON).
|
||||
- Exit code 0 if answered, 1 on timeout or error.
|
||||
|
||||
**\`cw answer\`** — Answer a pending question.
|
||||
\`\`\`
|
||||
cw answer "<answer>" --conversation-id <CONVERSATION_ID>
|
||||
\`\`\`
|
||||
- \`--conversation-id\` (required): The conversation ID from the listen output
|
||||
- Output (JSON): \`{ "conversationId": "...", "status": "answered" }\`
|
||||
|
||||
### Background Listener Pattern
|
||||
|
||||
At the START of your session, set up a background listener that writes to a temp file:
|
||||
\`\`\`bash
|
||||
cw listen --agent-id <YOUR_AGENT_ID> &
|
||||
CW_LISTEN_FILE=$(mktemp /tmp/cw-listen-XXXXXX.txt)
|
||||
cw listen --agent-id <YOUR_AGENT_ID> --timeout 120000 > "$CW_LISTEN_FILE" 2>&1 &
|
||||
LISTEN_PID=$!
|
||||
\`\`\`
|
||||
|
||||
When the listener prints JSON to stdout, another agent is asking you a question:
|
||||
\`\`\`json
|
||||
{ "conversationId": "...", "fromAgentId": "...", "question": "..." }
|
||||
Periodically check for incoming questions between your work steps:
|
||||
\`\`\`bash
|
||||
LISTEN_CONTENT=$(cat "$CW_LISTEN_FILE" 2>/dev/null)
|
||||
if [ -n "$LISTEN_CONTENT" ]; then
|
||||
echo "$LISTEN_CONTENT"
|
||||
fi
|
||||
\`\`\`
|
||||
|
||||
Answer it:
|
||||
When a question arrives, parse the JSON, answer, then restart the listener:
|
||||
\`\`\`bash
|
||||
# Parse conversationId and question from the JSON
|
||||
cw answer "<your answer>" --conversation-id <conversationId>
|
||||
\`\`\`
|
||||
|
||||
Then restart the listener:
|
||||
\`\`\`bash
|
||||
cw listen --agent-id <YOUR_AGENT_ID> &
|
||||
# Clear and restart
|
||||
> "$CW_LISTEN_FILE"
|
||||
cw listen --agent-id <YOUR_AGENT_ID> --timeout 120000 > "$CW_LISTEN_FILE" 2>&1 &
|
||||
LISTEN_PID=$!
|
||||
\`\`\`
|
||||
|
||||
### Asking Questions
|
||||
To ask another agent a question (blocks until answered):
|
||||
\`\`\`bash
|
||||
cw ask "What interface does the user service expose?" --from <YOUR_AGENT_ID> --agent-id <TARGET_AGENT_ID>
|
||||
\`\`\`
|
||||
|
||||
You can also target by task or phase:
|
||||
\`\`\`bash
|
||||
cw ask "What port does the API run on?" --from <YOUR_AGENT_ID> --task-id <TASK_ID>
|
||||
cw ask "What schema are you using?" --from <YOUR_AGENT_ID> --phase-id <PHASE_ID>
|
||||
\`\`\`
|
||||
|
||||
### When to Communicate
|
||||
- You need interface/schema/contract info from another agent's work
|
||||
- You need interface, schema, or API contract info from another agent's work
|
||||
- You're about to modify a shared resource and want to coordinate
|
||||
- You have a dependency on work another agent is doing
|
||||
- Do NOT ask questions that you can answer by reading the codebase yourself
|
||||
|
||||
### Cleanup
|
||||
Before writing \`.cw/output/signal.json\`, kill your listener:
|
||||
\`\`\`bash
|
||||
kill $LISTEN_PID 2>/dev/null
|
||||
rm -f "$CW_LISTEN_FILE"
|
||||
\`\`\``;
|
||||
|
||||
Reference in New Issue
Block a user