hn.today

Show HN: Critic – Review code with the agent that wrote it

critic.run7 points1 comments
Screenshot of Show HN: Critic – Review code with the agent that wrote it

This describes a code review tool that keeps conversational questions to code-writing agents alive across device disconnects by introducing a leased handoff model. Previously the web app queued questions and assumed authors’ machines stayed online and session transcripts lived locally; now each question is owned by exactly one connected device at a time and ownership is granted by a short lease (45 seconds) that can be claimed atomically. When a device goes offline its claim expires and the work becomes available to other connected author devices while the original coding session remains the authoritative context. The change includes discussion about design choices (lease token vs. heartbeat) and operational concerns like capping retry attempts for questions that crash repeatedly.

The implementation touches three areas: a durable agent-questions queue that converts best-effort enqueueing into leased claims (agentQuestions.ts), a conservative anchor-moving algorithm that favors exact blob matches, scores rename and surrounding-context candidates, and surfaces ambiguous close matches instead of silently attaching to the wrong line (project-anchor.ts), and a UI update that displays which device is answering and treats stale leases as a Reconnecting state rather than an empty row (agent-question-status.tsx). The result is more reliable, transparent multi-device agent review behavior and reduced risk of lost threads or misattached context.

Read on critic.run1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.