Skip to content

Background task completion does not resume agent in idle sessions #773

Description

@guoh27

Background task completion does not resume agent in idle sessions

Environment

  • pi-web version: 0.9.0
  • timeout: 0

Problem

When a session enters the idle state while one or more background tasks are still running, completion of those background tasks does not wake the session or resume the agent.

This is not caused by the session exceeding its timeout. I have explicitly configured:

timeout = 0

The session is still valid and has not been terminated due to timeout.

However, after the background task finishes, the session remains idle and the agent does not continue execution until a user manually sends another message.

Reproduction

  1. Start an agent session.
  2. Let the agent launch one or more background tasks.
  3. The agent finishes its current turn and the session enters the idle state.
  4. Wait for the background task to complete.
  5. Observe that the session remains idle.
  6. The agent does not automatically resume.
  7. Send any manual user message, and the agent can continue normally.

Actual behavior

Agent starts background task
        ↓
Agent becomes idle
        ↓
Background task completes
        ↓
Session stays idle
        ↓
Agent does not continue

A manual user message is required to wake the session and resume agent execution.

Expected behavior

If an idle session still has background tasks associated with it, completion of those tasks should trigger a wake-up/resume event for the session.

Agent starts background task
        ↓
Agent becomes idle
        ↓
Background task completes
        ↓
Session is awakened
        ↓
Agent resumes and processes the result

In other words, an idle session should still be able to receive background-task completion events and use them to resume agent execution, as long as the session has not actually timed out or been terminated.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions