Skip to content

Bug: Complete embedded LLM lifecycle results and readiness checks #135

Closed

Description

@BerryUIKI

Summary

A mocked successful LlamaServerSupervisor.stop() returned None, despite its dictionary return annotation. main.py:152 automatically starts the first available local model at backend startup. The runtime uses a fixed port and starts without awaiting service readiness; local-provider configuration can appear ready before installation/health is established.

Environment and evidence

  • Review finding: F35 (2026-10-05 product/technical review).
  • Baseline: Windows, dev at c1c5dbe. The remote dev matched this commit when filing.
  • Evidence: Reproduced + Code.
  • Priority recommendation: P2 - material improvement or integration validation. This is review triage, not a production-incident severity declaration.
  • No real credentials, paid inference, engine installation, or unrelated process termination were used for review probes. Mocked observations establish the stated code behavior, not live-provider/GPU acceptance.

Reproduction or validation

Mock LlamaServerSupervisor.get_pid, subprocess.run, and PID cleanup, then call stop: successful termination returns None despite its dictionary annotation. No real process was terminated. Source review also found automatic startup of the first local model, fixed-port use, and no awaited readiness before reporting start success.

User impact

Stop callers cannot rely on a result, startup can unexpectedly consume resources, and the Agent can appear available while its service is unavailable.

Proposed approach

Return explicit lifecycle results, honor a saved opt-in/start preference, select a known model, check port ownership, and report health separately from installation and PID state.

Acceptance criteria

  • All start/stop paths return explicit structured results.
  • Local startup follows a saved opt-in preference and selected model.
  • Check port ownership and service readiness independently of PID existence.
  • Provider configuration is not presented as readiness when runtime/model is missing.
  • Tests cover absent/starting/healthy/failed services and successful stop.

Additional source references

Related work

Related closed issue: #96. Embedded llama-server was implemented. This report concerns remaining lifecycle result and readiness contracts.

Verification scope

Real GPU inference, paid-provider compatibility, and a clean-machine packaged desktop journey remain unverified. Any follow-up implementation should target dev under the repository's contribution/branching rules.

Activity

  1. added
    bugSomething isn't working
    backendBackend Python / FastAPI / Engine issues
    frontendFrontend React / TypeScript / UI issues
    on Oct 4, 2026
  2. BerryUIKI commented on Oct 7, 2026

    @BerryUIKI
    OwnerAuthor

    Fixed in PR #166. The llama-server installation now dynamically fetches the latest binary release from GitHub API, and the stop() method always returns a proper dictionary structure to prevent HTTP 500 errors.

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

    backendBackend Python / FastAPI / Engine issuesbugSomething isn't workingfrontendFrontend React / TypeScript / UI issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions