Skip to content

perf(artifact-delivery): answer Resolution polls when the build moves - #497

Merged
harlan-zw merged 2 commits into
mainfrom
perf/run-wait
Oct 7, 2026
Merged

harlan-zw merged 2 commits into
mainfrom
perf/run-wait

Conversation

@harlan-zw

@harlan-zw harlan-zw commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

None. Launch prep for skilld run latency.

❓ Type of change

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

📚 Description

A run spends most of its time waiting for its build, and two parts of that wait were fixed costs.

  • Polls waited a full second. A pending Resolution named pollAfterMs: 1000, so the CLI saw a finished build up to a second after it landed. In every timed production run on 2026-10-07, the CLI polled once every 1.1 to 1.2 s. A read of a building Resolution now waits up to 8 seconds for its state to change, checking D1 every 250 ms, and the answer names pollAfterMs: 250. A settled Resolution answers at once. Released CLIs follow the interval the server names, so they need no update.
  • The queue send held the first answer. In three production traces of POST /api/v1/resolutions, from Sydney and Bangkok, the queue send took 446 to 500 ms of a 588 to 1,738 ms request. The send now runs in waitUntil after the response. A send that fails settles the Resolution as a retryable SERVICE_UNAVAILABLE, so the polling CLI requests a new Resolution instead of waiting out its 60 second deadline.

Where a run waits: the POST route sends the build message after its response, and the GET route holds a poll until the Resolution changes state

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

A run waited for its build in one second steps, so the CLI saw a
finished build up to a second after it landed. A read of a building
Resolution now waits up to 8 seconds for its next state, checking every
250 ms, and the poll interval drops to 250 ms.

The queue send took 446 to 500 ms of each Resolution request in three
production traces. The CLI polls for the result anyway, so the send now
runs after the response. A send that fails settles the Resolution as a
retryable SERVICE_UNAVAILABLE, so the CLI requests a new one.
@harlan-zw harlan-zw added the harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. label Oct 6, 2026
@harlan-github-agent harlan-github-agent Bot added harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. and removed harlan-agent-review Pull request triage requires an adversarial Review. Adding this label manually always forces one. labels Oct 6, 2026
@harlan-github-agent

harlan-github-agent Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-10-07 00:58 UTC.

GitHub merged this pull request.

  • Logged (20/100): A failed queue send whose failure settlement also fails rejects unhandled and hides the failure from the CLI. View code
    • Ask an agent to verify and fix this finding

3b248c89-e379-4f82-86e6-a80b398cdc34

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added harlan-agent-blocked The automated Review found a material defect in this head commit. and removed harlan-agent-review-required Pull request triage requires an adversarial Review for this head commit. labels Oct 6, 2026
Comment thread layers/artifact-delivery/server/api/v1/resolutions/index.post.ts Outdated

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: BLOCKED.

Read the Review results

@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. and removed harlan-agent-blocked The automated Review found a material defect in this head commit. labels Oct 6, 2026
@harlan-zw
harlan-zw added this pull request to stack #509 October 6, 2026 16:22
@harlan-github-agent harlan-github-agent Bot added harlan-agent-running An Agent holds a Task on this issue or pull request right now. harlan-agent-ready The automated Review passed every gate on this head commit. and removed harlan-agent-running An Agent holds a Task on this issue or pull request right now. labels Oct 6, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: READY.

Read the Review results

@harlan-zw
harlan-zw merged commit e7e2fcd into main Oct 7, 2026
7 checks passed
@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Oct 7, 2026
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.

1 participant