Timmy Asks Clarifying Questions Before Work #2

Open
opened 2026-03-20 22:21:12 +00:00 by replit · 0 comments
Owner

What & Why

After a job passes eval but before the work payment invoice is generated, Timmy asks 1-2 targeted clarifying questions if the request is ambiguous. This produces better outputs, reduces wasted sats on misunderstood jobs, and makes Timmy feel like a thoughtful collaborator.

Done looks like

  • After eval passes, a Haiku call decides: needs clarification? + up to 2 short questions if yes
  • Job enters new awaiting_clarification state; questions appear in Workshop chat
  • Visitor answers via the same input bar; answers appended to job context
  • After answers (or 5-min timeout), job proceeds to work payment
  • Questions and answers stored with the job record

Out of scope

  • Multi-round clarification loops (one round only)
  • Free chat

Tasks

  1. New job state + DB column — Add awaiting_clarification to job state machine; add clarification_questions JSONB and clarification_answers columns.
  2. Clarification decision call — After eval passes, run Haiku call; if needed, transition state and broadcast questions via WebSocket.
  3. Answer capture — Accept visitor answers from WebSocket; store and transition to awaiting_work_payment.
  4. Frontend clarification UI — Render Timmy's questions in chat with a prompt for the visitor to answer.

Relevant files

  • artifacts/api-server/src/lib/agent.ts
  • artifacts/api-server/src/routes/jobs.ts
  • artifacts/api-server/src/routes/events.ts
  • the-matrix/js/websocket.js
  • the-matrix/js/ui.js
## What & Why After a job passes eval but before the work payment invoice is generated, Timmy asks 1-2 targeted clarifying questions if the request is ambiguous. This produces better outputs, reduces wasted sats on misunderstood jobs, and makes Timmy feel like a thoughtful collaborator. ## Done looks like - After eval passes, a Haiku call decides: needs clarification? + up to 2 short questions if yes - Job enters new `awaiting_clarification` state; questions appear in Workshop chat - Visitor answers via the same input bar; answers appended to job context - After answers (or 5-min timeout), job proceeds to work payment - Questions and answers stored with the job record ## Out of scope - Multi-round clarification loops (one round only) - Free chat ## Tasks 1. **New job state + DB column** — Add `awaiting_clarification` to job state machine; add `clarification_questions` JSONB and `clarification_answers` columns. 2. **Clarification decision call** — After eval passes, run Haiku call; if needed, transition state and broadcast questions via WebSocket. 3. **Answer capture** — Accept visitor answers from WebSocket; store and transition to `awaiting_work_payment`. 4. **Frontend clarification UI** — Render Timmy's questions in chat with a prompt for the visitor to answer. ## Relevant files - `artifacts/api-server/src/lib/agent.ts` - `artifacts/api-server/src/routes/jobs.ts` - `artifacts/api-server/src/routes/events.ts` - `the-matrix/js/websocket.js` - `the-matrix/js/ui.js`
replit added the workshopbackendfrontendai labels 2026-03-20 22:21:12 +00:00
gemini was assigned by Rockachopa 2026-03-22 23:37:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#2