Skip to content

Add update-task-v2 endpoint with tight execute loop and reduce log verbosity#383

Merged
v1r3n merged 2 commits intomainfrom
sdk_updates_mar8
Mar 10, 2026
Merged

Add update-task-v2 endpoint with tight execute loop and reduce log verbosity#383
v1r3n merged 2 commits intomainfrom
sdk_updates_mar8

Conversation

@v1r3n
Copy link
Contributor

@v1r3n v1r3n commented Mar 9, 2026

Summary

  • Update Task V2 endpoint: Added update_task_v2 to both TaskResourceApi (sync) and AsyncTaskResourceApi (async), calling POST /tasks/update-v2 which combines task update + poll into a single HTTP call, returning
    the next task to process
  • Tight execute loop: __execute_and_update_task now loops (execute → update_v2 → get next task → execute → ...) instead of returning after a single task, reducing poll overhead and latency
  • Async task completion: When an async task completes, the v2 response's next task is submitted back to the executor thread pool
  • Log verbosity: Moved verbose task registration logs (banners, schema details, TaskDef field listings, "View at" URLs) from INFO to DEBUG — only final registration outcomes remain at INFO
  • Process termination safety: TaskHandler now guards against terminating processes that were never started or already stopped
  • Auth failure reset: Reset auth failure counter on any successful HTTP poll response, not just when tasks are returned
  • Removed dead code: Deleted unused __poll_task single-task poll method (superseded by batch polling)
  • Package setup: Added pythonpath to pytest config, added extend_path to conductor/init.py for namespace package support

Test plan

  • Run unit tests for TaskRunner, AsyncTaskRunner, and TaskHandler — verify updated mock expectations for update_task_v2
  • Integration test: start workers, verify tight loop processes consecutive tasks without re-polling
  • Integration test: verify 204 (no next task) breaks the loop gracefully
  • Verify INFO logs on startup are concise; enable DEBUG to see full registration details
  • Test async worker completion path — confirm next task from v2 is picked up

manan164

This comment was marked as resolved.

@v1r3n v1r3n merged commit 8f2b9dc into main Mar 10, 2026
1 check passed
@v1r3n v1r3n deleted the sdk_updates_mar8 branch March 10, 2026 15:34
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.

2 participants