Skip to content

feat(ws): add polling fallback rollout controls#186

Merged
iAziz786 merged 1 commit intomainfrom
polling-fallback-rollout
Apr 28, 2026
Merged

feat(ws): add polling fallback rollout controls#186
iAziz786 merged 1 commit intomainfrom
polling-fallback-rollout

Conversation

@iAziz786
Copy link
Copy Markdown
Contributor

Summary

Add independent rollout flags, effective delivery gating via hello handshake, polling pause/resume coordination, and duplicate-execution safety during polling/WS overlap transitions.

Changes

Hostlink

  • Config: HOSTLINK_WS_RESULTS_ENABLED, HOSTLINK_WS_DELIVERY_ENABLED, HOSTLINK_WS_POLLING_FALLBACK_THRESHOLD, plus parseBoolEnabled helper
  • Rollout coordinator: shared rollout.Coordinator tracks effective delivery state, drives polling gate and timeout-based fallback
  • Protocol: agent.hello.payload.capabilities (results_enabled, delivery_enabled), agent.hello_ack.payload.delivery_enabled with reconciliation directives
  • WS client gating: delivery/reject task.deliver when disabled, skip result channel when results disabled, preserve HTTP fallback
  • Runner: PollingGate interface suppresses fetch when coordinator says polling not needed

Rails

  • Rollout policy: AgentWebsocketRolloutPolicy with env-backed gateway/delivery enablement + optional canary allowlists by agent/org PID
  • Hello activation: computes effective delivery_enabled from hostlink capabilities + server policy, includes in agent.hello_ack
  • Registry: tracks per-agent delivery state alongside connectivity; post-commit delivery checks respect it
  • Polling fallback: AgentsController#index returns same-agent leased pending tasks with execution_attempt_id; foreign active leases hidden

Duplicate Safety

  • Runner dedupes by task_id + execution_attempt_id, plus task_id fallback during polling/WS overlap windows
  • Post-hello delivery check and after-commit triggers both gate on effective delivery state

Docs

  • Updated SPEC.md, specs/10-polling-fallback-rollout.md, .context/agents-and-heartbeats.md with actual flag names and fallback rules

…ello capability exchange, and overlap suppression
@iAziz786 iAziz786 merged commit 5b802b0 into main Apr 28, 2026
1 check passed
@iAziz786 iAziz786 deleted the polling-fallback-rollout branch April 28, 2026 12:39
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