Skip to content

feat: persist automation task outcomes - #329

Draft
malhotra5 wants to merge 1 commit into
mainfrom
task-outcome-persistence
Draft

feat: persist automation task outcomes#329
malhotra5 wants to merge 1 commit into
mainfrom
task-outcome-persistence

Conversation

@malhotra5

Copy link
Copy Markdown
Member

Summary

  • Pin automation to the SDK PR commit that reports task outcomes.
  • Add AutomationRun.task_outcome storage, migration, callback schema/handler support for agent_outcome and task_outcome, and response serialization.
  • Advertise callback support to SDK scripts and recover task outcomes through agent-server conversation metadata when watchdog fallback verifies a missed callback.
  • Print conversation IDs from prompt/plugin presets so fallback recovery can locate the conversation reliably.

Tests

  • uv run pre-commit run --files openhands/automation/models.py openhands/automation/schemas.py openhands/automation/router.py openhands/automation/watchdog.py openhands/automation/utils/agent_server.py openhands/automation/utils/sandbox.py openhands/automation/dispatcher.py openhands/automation/execution.py openhands/automation/presets/prompt/sdk_main.py openhands/automation/presets/plugin/sdk_main.py tests/test_router.py tests/test_watchdog.py tests/test_local_mode.py tests/test_db.py tests/test_schemas.py migrations/versions/015_add_run_task_outcome.py --show-diff-on-failure
  • uv run pytest tests/ -q --ignore=tests/integration

This PR was created by an AI agent (OpenHands) on behalf of the user.

@malhotra5 can click here to continue refining the PR

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions github-actions Bot added the type: feat A new feature label Aug 12, 2026

@smolpaws smolpaws left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐾 smolpaws (for Engel). The watchdog fallback here (get_conversation_task_outcomeGET /api/conversations/:id.task_outcome) can read a stale outcome.

task_outcome is persisted on the conversation and never reset on resume (SDK #4465). So a conversation that continues past its first finish — e.g. a Slack run that replies, user messages again, same conversation resumes — keeps the previous run's outcome until a new one is written. If that resumed run ends without a finish, the fallback recovers the previous run's outcome.

Best fixed on the SDK side (clear/mark in-progress at run start); flagging here so the recovery path is aware. Primary callback path is fine when a run sets a fresh outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants