Skip to content

feat: project-level PM agent chat#5

Merged
gf5901 merged 1 commit into
mainfrom
feat/project-pm-chat
Mar 22, 2026
Merged

feat: project-level PM agent chat#5
gf5901 merged 1 commit into
mainfrom
feat/project-pm-chat

Conversation

@gf5901
Copy link
Copy Markdown
Owner

@gf5901 gf5901 commented Mar 22, 2026

Summary

  • Adds a unified Project Manager (PM) agent that humans can converse with from the project detail page. The PM has full project context (spec, tasks, plans, proposals, KPIs) via ./ctx and can create agent-assigned or human-assigned tasks as side-effects.
  • Stores chat messages as CHAT#<iso> DynamoDB records under the project. Uses reply_pending on the PROJECT item for poller-driven dispatch (same pattern as task comment replies).
  • Posts proactive system messages to the chat when tasks complete/fail, autopilot plans are proposed/paused, and daily cycle proposals are generated — so the PM chat serves as a live project activity feed.

Files changed (16)

Backend (Python)

  • src/pm_agent.py — new PM agent: prompt, ./ctx wiring, JSON action parsing, run_pm_reply()
  • src/projects_dynamo.pyCHAT# CRUD, reply_pending helpers, claim_project_pm_reply() (atomic)
  • src/pipeline.py — system messages on task terminal states
  • src/autopilot.py — system messages on plan proposed / cycle paused
  • src/objectives.py — system message summarising daily cycle output
  • run_task.py--pm-reply <project_id> entry point
  • run_poller.py — polls list_project_reply_pending(), spawns PM runners

API (TypeScript/Hono)

  • infra/packages/api/src/routes/projects.tsGET/POST /api/projects/:id/chat
  • infra/packages/api/src/lib/dynamo.tsgetProjectChat(), addProjectChatMessage()
  • infra/packages/api/src/lib/types.tsProjectChatMessage, reply_pending on Project

Frontend (React)

  • frontend/src/pages/ProjectDetail.tsx — chat thread with PM/system/user styling + reply indicator
  • frontend/src/lib/api.tsfetchProjectChat(), postProjectChat()
  • frontend/src/lib/types.tsProjectChatMessage type

Docs

  • docs/dynamo-schema.md, src/AGENTS.md, frontend/AGENTS.md

Test plan

  • Create a project, navigate to detail page, verify "Project manager" chat section renders
  • Post a message, verify it appears and reply_pending indicator shows
  • Verify PM agent responds (once EC2 poller picks it up)
  • Verify system messages appear when a project task completes
  • Verify ruff, frontend typecheck, API typecheck+lint+tests pass (all verified locally)

Made with Cursor

Add a unified project manager agent that humans can talk to from the
project detail page. The PM agent gets full project context via ./ctx
(spec, tasks, plans, proposals, KPIs, human-tasks) and can create
agent or human-assigned tasks as side effects of the conversation.

Backend:
- CHAT# records under PROJECT# in DynamoDB (same pattern as task COMMENT#)
- reply_pending on PROJECT for poller-driven dispatch
- src/pm_agent.py: run_pm_reply() with MODEL_FULL, ./ctx, JSON actions
- run_task.py --pm-reply, run_poller.py polls list_project_reply_pending()
- System messages posted proactively on task terminal, autopilot plan
  proposed/paused, and daily cycle proposals

API:
- GET/POST /api/projects/:id/chat endpoints
- Project.reply_pending + ProjectChatMessage type

Frontend:
- Chat thread on ProjectDetail with PM/system/user message styling
- "PM is preparing a reply…" indicator while reply_pending
- Polls every 3s while busy (existing mechanism)

Made-with: Cursor
@gf5901 gf5901 merged commit 1651740 into main Mar 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant