Skip to content

fix(registry): stop purpose retries for rejected AI inputs - #773

Open
harlan-github-agent[bot] wants to merge 1 commit into
mainfrom
fix/issue-770
Open

harlan-github-agent[bot] wants to merge 1 commit into
mainfrom
fix/issue-770

Conversation

@harlan-github-agent

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #770

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

A deterministic AiGateway 7003 reproduces for the same evidence on every attempt. listRepositoryPurposeCandidates blocked a failed purpose job for only one day, so boshi-xixixi/traeskill re-enqueued daily and dead-lettered its 5 attempts each day for 7 consecutive days:

exception: "AiGatewayError: 7003: User Input Error"
attempts: 5, max_attempts: 5, failed_at: 1796307369

The classification path now treats that gateway rejection shape as permanent, following the missing source precedent from #593. A terminal attempt records a rejection in a new repository_purpose_input_errors table (migration 0166), and the candidate query blocks on that row beyond the one day failed_jobs wait. The block lifts when the repository pushes, the prompt changes, or the model changes, so new evidence gets one more classification. A successful classification clears the row. Transient gateway errors, such as the 7005 billing error, never write a row and keep the normal retry clock.

The purpose job ends an input_rejected outcome on its first attempt with ctx.fail, and checkRepositoryPurposeAdmission holds the submission with the recorded reason.

Open points:

  • The first attempt after deploy still dead-letters once, because the rejection row can only be written by the failing job. After that the scheduler stops re-enqueueing.
  • What makes this repository's evidence reject at the gateway is unknown. The block removes the daily burn and retries on new evidence.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Dec 3, 2026
@harlan-github-agent

harlan-github-agent Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

🟢 Ready · 80/100

Checked: Candidate blocking SQL, rejection persistence and clearing, the job's input_rejected fail path, the admission hold, migration 0166 schema, and the new sqlite-backed unit tests covering transient 7005, push-unblock, and admission-hold cases. Not checked: The unchanged admission caller and scheduler enqueue paths, and the production env.AI.run error text the rejection regex must match.

1 note below 40/100 not shown.

2026-12-03 16:25 UTC · Harlan Agent Kit automated review, not Harlan's; a person merges · AI policy · @harlan-agent rerun · @harlan-agent stop

@harlan-github-agent harlan-github-agent Bot added the harlan-agent-ready The automated Review passed every gate on this head commit. label Dec 3, 2026

@harlan-github-agent harlan-github-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Ready · read the review

Harlan Agent Kit automated review, not Harlan's · AI policy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

harlan-agent-ready The automated Review passed every gate on this head commit.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Purpose job refails daily on a permanent AI input error

0 participants