Skip to content

fix(io): remove obsolete stdin fd workaround - #2750

Open
jariy17 wants to merge 1 commit into
v1.xfrom
fix/remove-obsolete-bun-stdin-workaround
Open

jariy17 wants to merge 1 commit into
v1.xfrom
fix/remove-obsolete-bun-stdin-workaround

Conversation

@jariy17

@jariy17 jariy17 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Description

Read stdin through the configured process stream instead of reopening file descriptor 0.

The fd 0 path was added to work around imports draining or prematurely ending stdin under Bun. Bun fixed the paused-stdin behavior in 1.4.0, which is the version this repository now pins. Keeping the workaround causes delayed pipes to fail under Node: accessing process.stdin makes the pipe non-blocking, then the separate raw fd read can receive EAGAIN before the producer writes.

This removes the obsolete workaround and adds a cross-runtime subprocess regression test. The test imports Ink, starts resolving process.stdin, waits while the pipe is empty, and only then writes the value. It runs under both Bun and Node.

This is an alternative to #2748: instead of retaining a runtime-specific branch, it verifies that the original Bun condition no longer reproduces and removes the raw fd path entirely.

Bun context:

Related Issue

Closes #2747

Documentation PR

Not applicable; command syntax and documented behavior are unchanged.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

How have you tested the change?

  • I ran bun test
  • I ran the relevant end-to-end tests with bun run test:e2e, or explained why they are not applicable
    (CI does not run them for you)
  • I ran bun run typecheck
  • I ran bun run lint:check
  • I ran bun run format:check
  • I ran bun run audit
  • I ran bun run secrets:check
  • I ran bun run build
  • If I modified src/assets/, I updated affected snapshots with bun test <test-file> --update-snapshots and committed them
  • If I re-recorded fixtures or golden files, every change beyond account identifiers is explained
    by this PR
  • This PR does not change command.md (the release workflow regenerates it)

Results:

  • bun test: 4,704 passed, 6 skipped, 0 failed across 311 files.
  • Focused src/io/source.test.ts: 16 passed, including delayed stdin under Bun and Node after importing Ink.
  • Bug-bash suites covering invocation, shell, identity, credentials, evaluation, and project configuration: 503 passed.
  • Built Node CLI smoke test waited for delayed stdin and reached JSON validation instead of failing with EAGAIN.
  • AWS end-to-end tests are not applicable because this changes local stdin stream selection and requires no AWS resources.
  • bun audit could not use the configured CodeArtifact advisory endpoint (404). Against the public registry it reports one pre-existing moderate minimatch advisory through the lint/test development toolchain; this PR changes no dependencies.

The bug bash inventoried 38 handler and test files using SourceResolver, covering 21 stdin-backed option names. Injected streams already used the configured stream directly, so the behavior change is limited to real process.stdin; the full suite checks the shared resolver consumers for regressions.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@jariy17
jariy17 requested a review from a team November 3, 2026 20:23
@github-actions github-actions Bot added the size/s PR size: S label Nov 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-1.0.1.tgz

How to install

gh release download pr-2750-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-1.0.1.tgz

@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Nov 3, 2026
@jariy17 jariy17 mentioned this pull request Nov 3, 2026
11 of 18 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdin secret flags (--bearer-token -, --api-key -, …) fail under Node when input arrives late

1 participant