Skip to content

Long-running work: finish notifications and background commands #51

Closed

Description

@nasser1941

Problem

  • Users walk away from slow requests. Local models are slow, so users switch to something else during long requests and don't know when one finishes or needs approval.
  • Long-running processes block the model. It can't start a dev server or a test watcher and keep working, because bash waits for the command to end, or times out.

Proposal

  • Notifications: a desktop notification when a request that took longer than N seconds finishes, or when it waits for approval.
    • It uses notify-send on Linux and osascript on macOS, with the terminal bell as a fallback.
    • Settings: notify = on | off and the time threshold.
    • Good first issue.
  • Background commands: bash with background: true starts a process and returns an id.
    • bash_output(id) reads its new output and bash_stop(id) stops it.
    • Background processes are stopped when the session ends and listed in /jobs.

Acceptance criteria

  • A notification after long requests and approval prompts, on Linux and macOS
  • Background commands with output and stop; cleaned up at session end
  • Tests and docs

Activity

  1. nasser1941 commented on Oct 6, 2026

    @nasser1941
    OwnerAuthor

    Shipped in 0.20.0 (#85): background commands (bash with background: true, bash_output, bash_stop, /jobs) and desktop notifications (notify, notify_after). See Background commands and Notifications.

    Tested with Qwen3.6 35B through Ollama, also from the PyPI build:

    • Background commands: asked to start a web server, check it with curl, read its output and stop it, the model used bash(…, background=true), curl, bash_output and bash_stop. The port was closed afterwards.
    • Leftovers of &: a command that starts something with & no longer hangs until its timeout. What it left running is stopped, and the model is pointed to background commands.
    • Notifications: a desktop notification on Linux, checked with dbus-monitor: "lcode is done", with the request and how long it took. The macOS path (osascript) is covered by tests but not run on a Mac.
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions