Skip to content

Automate agent-flow (stuck-state) coverage as e2e with a stub model #1526

Closed

Description

@malibio

Overview

Local-agent flow bugs (stuck processing, hangs, download stuck at 100%) recur and are exercised only manually via a shell script. They are not covered by any automated test.

Problem Statement

The agent-loop seam has no automated coverage that a turn always terminates (even if the engine never emits a done marker), that a second message reuses the loaded engine, and that the download state machine reaches a terminal state.

Proposed Solution

Add agent-loop integration tests with a fake/stub inference engine asserting loop termination, engine reuse, and live embedding-handle reads; add an e2e for ai-chat send→idle and model-download terminal states with a stub model.

Acceptance Criteria

  • Agent-loop tests assert termination, engine reuse, and no stuck state with a stub engine
  • An e2e covers ai-chat send→idle and download terminal state
  • Code passes bun run quality:fix; tests pass

Technical Specifications

Reference Files

  • packages/agent/src/local_agent/{agent_loop,ollama_inference,model_manager}.rs, daemon local_agent_service.rs, scripts/aichat.sh
  • Context: ADR-048

Related Issues

Activity

  1. malibio commented on Jul 11, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 4018 passed, 1 known-flaky failure (architecture-benchmarks.test.ts bulk structural 25ms threshold — machine-load flaky, unrelated to this issue).

  2. self-assigned this
    on Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions