Skip to content

Batch managed-server log delivery before MainActor publication #2

Description

@acari-git

Problem

ManagedServerOutputCoordinator.begin currently creates a Task { @MainActor ... } for every output line. AppViewModel.handleManagedServerOutput then calls appendLog for each line, which rebuilds LogViewState. Under bursty model output this can create unnecessary MainActor work.

Current verification (2026-08-15)

  • LogStateCoordinator.append(contentsOf:) supports batch updates.
  • Managed server output still reaches it one line at a time.
  • LogStateCoordinatorTests pass.

Desired behavior

  • Buffer managed-server output off the MainActor.
  • Publish bounded batches (for example every 50–100 ms or by batch size).
  • Preserve line order, bounded history, fault detection, and final output on process termination.
  • Add a burst regression test that verifies MainActor publication count is substantially lower than line count.

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