_syncHostJobs runs on facet instances even though the root owns the alarm
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start at Agent._syncHostJobs() and compare its facet behavior with rootAlarmOwner(), which delegates alarm scheduling to the root. Verify that facet instances skip host-job synchronization while root instances retain it, and confirm that facet wakes no longer create schedule_agent_alarm spans; the root should still synchronize its host jobs.
Written by the indexing model from the issue text.
Description
Summary
Agent._syncHostJobs() runs on facet instances as well as on the root. A facet cannot own the alarm (its scheduling is delegated to rootAlarmOwner()), so every facet wake still opens a schedule_agent_alarm span and synchronises host jobs that the root already owns. On a parent with several long-lived facets this is wasted storage and span volume on every wake, and it makes the facet's trace look like an alarm owner.
Seen on agents@0.23.0.
Suggestion
Return early from _syncHostJobs() when this._isFacet is set. We carry exactly that one-line guard as a local patch and have not seen a facet-side job that needed the sync; if there is one, a facet-specific path would be clearer than running the root's synchronisation on every facet.
- Dominant language
- TypeScript
- Stars
- 5.6k
- Forks
- 726
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 49
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudflare/agents
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
cloudflare/agents#2309 · 1 comment ·
-
think
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cloudflare/agents#2119 · 1 comment ·
-
bug
cloudflare/agents#2308 · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
cloudflare/agents#2305 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
cloudflare/agents#2300 ·
All issues in cloudflare/agents
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·