Skip to content

feat(hostlink): split TaskJob into shared runner and executor, route polling through enqueue, separate durable start from transport start#184

Open
iAziz786 wants to merge 2 commits intomainfrom
hostlink-runner-refactor
Open

feat(hostlink): split TaskJob into shared runner and executor, route polling through enqueue, separate durable start from transport start#184
iAziz786 wants to merge 2 commits intomainfrom
hostlink-runner-refactor

Conversation

@iAziz786
Copy link
Copy Markdown
Contributor

@iAziz786 iAziz786 commented Apr 28, 2026

Summary

Refactor TaskJob to decouple task receipt from execution so polling fallback and WebSocket delivery share one runner queue. Also splits the started lifecycle so durable local-state persistence happens before process launch, separate from task.started transport emission.

Changes

  • Shared runner queue: polling trigger no longer calls processTask directly; every task passes through Enqueue into one sequential runner loop
  • Executor extraction: shell launch, output capture, and result reporting live in taskExecutor, not TaskJob; polling and WS tasks share the same execution path
  • In-memory duplicate suppression: reserveAttempt/finishAttempt keyed by task_id + execution_attempt_id
  • Started lifecycle split: ResultChannel.RecordStarted persists running state before process launch; SendStarted only emits the transport message
  • WebSocket client: RecordStarted added, SendStarted slimmed to transport-only
  • Integration test timing: all TaskJobReporter integration tests updated for async runner model

Testing

go test ./app/jobs/taskjob ./app/services/wsclient ./app/services/localtaskstore ./internal/wsprotocol
go test -tags integration ./test/integration -run 'TaskJobReporter'

Note

This PR includes the uncommitted ws-task-delivery changes that were in the working tree. The effective runner-refactor change is best reviewed as the diff from the ws-push-task-delivery base.

…polling through enqueue, separate durable start from transport start
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