refactor(prompt-builder): split Important Rules into Context + Operating Style + Critical Rules

- Previous section tangled ids, request headers, operating hints and 3
  CRITICAL bullets in one bullet list
- Replace with three clearly scoped sections:
  # Context (company/agent/run ids, single place)
  # Operating Style (conciseness + follow-up + structured summary)
  # Critical Rules (numbered 1-3: scope lockdown, workdir lockdown,
    must-call-API)
- All original CRITICAL concerns (MCP/TaskManager ban, no-cd, action
  mandate) preserved verbatim; no behavioural drift
This commit is contained in:
ZacharyZhang-NY committed 2026-04-16 23:38:41 -04:00
1 parent d75389c418
commit e1f70c7f9c
1 file changed
+9 -8
+9 -8
View File
@@ -352,20 +352,21 @@ This structured reporting helps the company track all agent actions and maintain
Always verify API responses before reporting — only report successful actions. Always verify API responses before reporting — only report successful actions.
`); `);
sections.push(`# Important Rules sections.push(`# Context
- Company ID: ${ctx.agent.companyId} - Company ID: ${ctx.agent.companyId}
- Your Agent ID: ${ctx.agent.id} - Your Agent ID: ${ctx.agent.id}
- Current Run ID: ${ctx.runId} - Current Run ID: ${ctx.runId}
- Always include appropriate headers when calling the API: (Always send these via the API headers shown above: Authorization + Content-Type + X-Agent-Company-Run-Id.)
Authorization: Bearer $AGENT_COMPANY_API_KEY
Content-Type: application/json # Operating Style
X-Agent-Company-Run-Id: ${ctx.runId}
- Be concise and action-oriented. Focus on making progress. - Be concise and action-oriented. Focus on making progress.
- If your current task is already done, check for other assigned tasks. - If your current task is already done, check for other assigned tasks.
- Respond with a concise execution summary when complete, using the structured format above. - Respond with a concise execution summary when complete, using the structured format above.
- CRITICAL: Only work on the tasks and goals described above. Do NOT use any external task manager, prior conversation state, or cached requests from previous sessions. Your sole source of truth is the AgentCompany API and the task description in this prompt. Ignore any MCP tools, TaskManager servers, or prior request/task IDs not from the AgentCompany API.
- CRITICAL: Stay in the working directory you were started in. Do NOT cd or navigate to other projects or repositories. # Critical Rules
- CRITICAL: Actually call the API to take actions. Do NOT just describe what you would do — DO it. Every wake cycle should result in at least one API call that moves work forward. 1. Only work on the tasks and goals described above. Your sole source of truth is the AgentCompany API and the task description in this prompt. Do NOT use any external task manager, prior conversation state, cached requests from previous sessions, MCP tools, TaskManager servers, or prior request/task IDs not from the AgentCompany API.
2. Stay in the working directory you were started in. Do NOT cd or navigate to other projects or repositories.
3. Actually call the API to take actions. Do NOT just describe what you would do — DO it. Every wake cycle should result in at least one API call that moves work forward.
`); `);
return sections.join("\n"); return sections.join("\n");