GeezerVison is showing github.com — [WIP] feat: configurable worker sticky-cache + event-delivery metric by NiteshDhanpal · Pull Request #468 · scaleapi/scale-agentex-python
Conversation
[WIP] — not ready for merge; opening for early visibility.
What
Two independent, load-test-driven changes to the Temporal worker path:
-
**feat(temporal): expose max_cached_workflowsonAgentexWorker** The sticky workflow-cache size was hardcoded to the temporalio default (1000/worker) and not surfaced. Add a max_cached_workflowsparam (default **1000**, unchanged) and pass it intoWorker(...)`. No behaviour change for existing agents.
-
**feat(observability): agentex.events.deliverycounter**event/sendis accepted + acked by the ACP server **before** the Temporal signal is attempted, so HTTP success does not mean the event reached a live workflow. New counter tagged withoutcome (delivered/no_live_workflow/error), recorded around send_signalinTemporalTaskService.send_event. no_live_workflow=RPCError/NOT_FOUND(task already completed or idle-timed-out). Best-effort, gated onAGENTEX_EVENT_METRICS; send_event` still raises as before.
Why
A rocket-mock-async-agent load test showed 61% sticky-cache miss / 618k forced evictions → constant workflow replay, and the only "event success" signal was the ACP server's accept log (which hides events that never reached a live workflow). These two changes make the cache tunable and give a true delivery metric.
Verify (Mimir; OTLP → _total, dots→underscores)
sum(rate(agentex_events_delivery_total{outcome="delivered"}[5m]))
/ sum(rate(agentex_events_delivery_total[5m])) # true delivery rate
sum(rate(agentex_events_delivery_total{outcome="no_live_workflow"}[5m])) # arrived too late
Note
Paired with agentex-agents PR (raises this agent's max_cached_workflows/activity limits) — this SDK PR should merge first, since max_cached_workflows isn't a valid AgentexWorker kwarg until then.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add a max_cached_workflows parameter (default 1000, unchanged) to AgentexWorker and pass it through to the temporalio Worker. The sticky workflow-cache size was previously not configurable, so agents with many concurrent long-lived workflows (e.g. ones that park waiting for events) could not raise it above the SDK default, causing heavy sticky-cache eviction and constant workflow replay under load.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ts.delivery)
event/send is accepted and acked by the ACP server before the Temporal signal is attempted, so an HTTP success does not mean the event reached a live workflow. Add an agentex.events.delivery counter tagged with an outcome label (delivered / no_live_workflow / error) and record it around send_signal in TemporalTaskService.send_event. no_live_workflow (RPCError NOT_FOUND) captures events that arrived after the task completed or idle-timed-out. Recording is best-effort and gated on AGENTEX_EVENT_METRICS; behaviour is otherwise unchanged (send_event still raises).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.