Skip to content

[process] Investigate /dev/tty dependency in nested command orchestration #171

@coisa

Description

@coisa

Problem

Orchestration commands that spawn nested DevTools processes can fail in non-interactive contexts because a subprocess path still assumes an attached terminal and ends up trying to open /dev/tty.

In this environment, the failure shows up on commands such as:

  • composer dev-tools reports -- --cache-dir=/tmp/...
  • composer dev-tools standards -- --cache-dir=/tmp/...
  • composer dev-tools:fix

The concrete error is:

proc_open(/dev/tty): Failed to open stream: Device not configured

Direct commands such as tests, docs, wiki, and phpdoc still run successfully on their own. The problem appears when aggregate commands orchestrate nested subprocesses.

Why This Matters

This makes aggregate workflows less reliable in CI-like or non-interactive environments and complicates validation of otherwise-correct command behavior. It also means dev-tools:fix can fail for environmental reasons unrelated to the command logic being exercised.

Suspected Scope

The problem appears to be in the subprocess/orchestration layer rather than in individual tool integrations.

Potential areas to inspect:

  • process construction and queue execution for nested commands
  • Composer script / php bin/dev-tools invocation paths used by aggregate commands
  • any TTY auto-detection or explicit TTY wiring in the process builder / queue stack
  • command paths that derive terminal behavior from output style or interactivity assumptions

Expected Behavior

Aggregate commands should be able to run nested commands without requiring /dev/tty to be available.

In practice:

  • reports should run docs, tests, and metrics in non-interactive contexts
  • standards should run nested quality commands in non-interactive contexts
  • dev-tools:fix should not fail just because no TTY device is attached

Acceptance Criteria

  • Reproduce the /dev/tty failure deterministically in a non-interactive context.
  • Identify which layer or invocation path is causing the TTY dependency.
  • Remove or guard the TTY assumption so nested command execution works without an attached terminal.
  • Confirm reports, standards, and dev-tools:fix run in the affected context after the fix.
  • Document any remaining intentional TTY-dependent behavior if one truly exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Released

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions