Skip to content

Release a lead reservation that never got past being taken - #197

Merged
HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-8cmt7n
Oct 5, 2026
Merged

HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-8cmt7n

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Before: if crawl_lead_add failed after taking its daily slot but before planting a target, the crawl_lead row stayed pending and held one of the day's thirty slots.

After: that row is removed, but only while no target exists. Once targets.AddAsync has planted one, the row is the evidence for that target and stays pending; a retry answers already_queued. crawl_leads now says so.

How: ILeadLog.AbandonAsync deletes a row only when it is still pending with no crawl_target_id. LeadService.SubmitAsync calls it from a catch guarded on !dryRun && planted is null, swallowing any error from the cleanup so the original exception surfaces. Covered by two LeadServiceTests cases and one Postgres test.

Follow-up to CodeRabbit's review on #196.

🤖 Generated with Claude Code

https://claude.ai/code/session_012dFvvxSB84LHDrV6PxiMFP


Generated by Claude Code

A failure between taking the daily slot and planting a target left a
pending crawl_lead row holding one of the thirty slots for the day.
Remove it, but only while no target exists: once AddAsync has planted
one, the row is the evidence for it and stays, pending, so a retry
answers already_queued.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012dFvvxSB84LHDrV6PxiMFP
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Warning

Review paused — included plan limit reached

Keep your review moving with free on-demand reviews.

  • Run this review for free

On-demand reviews are free for the next 4 days.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Promotion and pricing details

On-demand reviews are free for the next 4 days. After that, they cost $0.25 per reviewed file.

Review limit details

Or wait 48 minutes for your next included review.

Check out review usage here.

Limit details: You’ve used the included review currently available. Your 69 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 45c7d124-ffbd-43f9-814a-c56d36454832
📥 Commits

Reviewing files that changed from the base of the PR and between 0f9433f and 29fb69c.

📒 Files selected for processing (6)
  • src/MUI.Crawler/Persistence/NpgsqlLeadLog.cs
  • src/MUI.Discovery/Intake/Lead.cs
  • src/MUI.Web/Mcp/CrawlAdminTools.cs
  • tests/MUI.Crawler.Tests/SubmissionPostgresTests.Leads.cs
  • tests/MUI.Discovery.Tests/Intake/LeadServiceTests.cs
  • tests/MUI.Discovery.Tests/Support/InMemoryLeadLog.cs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@HarryCordewener
HarryCordewener merged commit 3853b47 into main Oct 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants