Repository navigation
Draft the message instead of warning about it, and make the approvals queue usable - #37
Merged
Merged
Conversation
…e usable Two problems that together made the approvals page look broken. **Nothing ever retried a draft.** Drafting happens once, when the recommendation is created. If the composer was unavailable or declined that one time, the lead was permanently undraftable — and the send sweep found it on every tick, logged "no drafted message" and moved on. Production has 288 workflow events, all of them that warning, 98 of them for one prospect, while nothing attempted the thing being warned about. Autopilot now takes a model and writes the missing message before reporting; without a model the old report-and-skip behaviour is unchanged. **The queue was one undifferentiated list.** Production holds 73 `refresh_research` cards — internal actions that have no message by definition and never will — against a single email actually waiting for a decision. All 73 render as cards with nothing written on them, so the page reads as "the composer is broken" when it is really "you are looking at the wrong 73 rows". `GET /recommendations` takes `filter=ready|needs_draft|research|all` and returns counts for all four. The page defaults to `ready` — outbound work with a message already written — and an empty tab links to where the work actually is. `needs_draft` is the distinction that matters: a blank research card and an undrafted email look identical on screen and only one of them is a problem. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Changing fetchApprovals to return counts alongside the cards broke Today, which also calls it and treated the response as an array. The root typecheck does not cover apps/web — Next type-checks during its own build — so this only surfaced in CI's image job. Verified here by running the web build rather than trusting the root check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Answers "why are there still no AI-generated drafts here?" — there were two separate causes, and neither was the composer being broken.
Nothing ever retried a draft
Drafting happens once, when the recommendation is created. If the composer was briefly unavailable or declined that one time, the lead became permanently undraftable — and the send sweep then found it on every tick, logged
no drafted message, and moved on.Production has 288 workflow events. Every one of them is that warning. 98 of them are for a single prospect (Christian Heide), accumulated while nothing ever attempted the thing being warned about.
Autopilot now takes a model and writes the missing message before reporting. Without a model, the old report-and-skip behaviour is unchanged, and a composer that legitimately declines still produces a no-send — but now says why.
The queue was one undifferentiated list
Production holds 73
refresh_researchcards — internal actions that have no message by definition and never will — against one email actually waiting for a decision. All 73 render as cards with nothing written on them, so the page reads as "the composer is broken" when it is really "you are looking at the wrong 73 rows".GET /recommendationsnow takesfilter=ready|needs_draft|research|alland returns counts for all four. The page defaults toready— outbound work with a message already written — and an empty tab links to wherever the work actually is.needs_draftis the distinction that matters: a blank research card and an undrafted email look identical on screen, and only one of them is a problem.Verification
AS allwas a real bug caught by the suite —allis reserved in SQLite.Note on the log
You asked for a log to check periodically. One already exists and is live:
/todayrenders the workflow event feed (server-rendered, then live over SSE). It just happens to be showing 288 copies of the same warning right now, which this PR removes the cause of.🤖 Generated with Claude Code