feat: project-level PM agent chat#5
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
./ctxand can create agent-assigned or human-assigned tasks as side-effects.CHAT#<iso>DynamoDB records under the project. Usesreply_pendingon thePROJECTitem for poller-driven dispatch (same pattern as task comment replies).Files changed (16)
Backend (Python)
src/pm_agent.py— new PM agent: prompt,./ctxwiring, JSON action parsing,run_pm_reply()src/projects_dynamo.py—CHAT#CRUD,reply_pendinghelpers,claim_project_pm_reply()(atomic)src/pipeline.py— system messages on task terminal statessrc/autopilot.py— system messages on plan proposed / cycle pausedsrc/objectives.py— system message summarising daily cycle outputrun_task.py—--pm-reply <project_id>entry pointrun_poller.py— pollslist_project_reply_pending(), spawns PM runnersAPI (TypeScript/Hono)
infra/packages/api/src/routes/projects.ts—GET/POST /api/projects/:id/chatinfra/packages/api/src/lib/dynamo.ts—getProjectChat(),addProjectChatMessage()infra/packages/api/src/lib/types.ts—ProjectChatMessage,reply_pendingonProjectFrontend (React)
frontend/src/pages/ProjectDetail.tsx— chat thread with PM/system/user styling + reply indicatorfrontend/src/lib/api.ts—fetchProjectChat(),postProjectChat()frontend/src/lib/types.ts—ProjectChatMessagetypeDocs
docs/dynamo-schema.md,src/AGENTS.md,frontend/AGENTS.mdTest plan
reply_pendingindicator showsMade with Cursor