Skip to content

V2: define shell backgrounding semantics #34366

Description

@opencode-agent

Summary

Define and implement model-facing backgrounding for the V2 shell tool.

Current state

The V2 shell/bash tool runs synchronously with a timeout via AppProcess.run(...). The implementation has TODOs around background jobs, observation, restart recovery, and cancellation. BackgroundJob already exists and subagent background mode provides a useful precedent.

Design questions

  • Should shell accept background?: boolean?
  • What should the immediate return shape be when a command is backgrounded?
  • How should completion be delivered back into the session?
  • What owner-bound get/wait/cancel tools or APIs are needed?
  • What output is retained inline vs streamed/stored elsewhere?
  • What are the process cleanup and platform guarantees?
  • What, if anything, should be exposed over HTTP before durable status/restart recovery exists?

Acceptance criteria

  • Background shell semantics are documented.
  • Implementation uses owner/session-bound observation and cancellation.
  • Completion delivery is defined.
  • Output retention/truncation behavior is explicit.
  • Related existing shell background/hang issues are linked or closed as appropriate.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions