Skip to content

feat(flows): scope flows list --remote by environment via public API#1392

Merged
Chase J (chajac) merged 5 commits into
mainfrom
flows-list-remote-contract
Jul 15, 2026
Merged

feat(flows): scope flows list --remote by environment via public API#1392
Chase J (chajac) merged 5 commits into
mainfrom
flows-list-remote-contract

Conversation

@chajac

@chajac Chase J (chajac) commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Stacked on #1391.

Overview of Changes

flows list --remote previously called REST v0 (GET /api/v0/flows), which cannot scope by environment or include drafts. It now calls the public.flow.list tRPC endpoint through callPublicApi, using the contract from @qawolf/api-contracts@0.2.0 directly.

The command gains --env (required with --remote) and --include-drafts. Invalid flag combinations (--remote without --env; --env or --include-drafts without --remote) fail fast with clear errors before auth resolution. The REST v0 client (getRemoteFlows) is deleted. The agent skill commands table and help snapshots are regenerated.

Fixes an exit path crash the new instant error path exposed: pino’s async log destination races process.exit() when a command errors before the log fd opens, crashing pino’s exit time flushSync with “sonic boom is not ready yet”. The log fd is now opened eagerly at creation and handed to pino, so the exit time flush can never race the open while writes stay asynchronous.

Testing

bun run typecheck
bun run lint
bun run format:check
bun run knip
bun run test
bun run build

Manual smoke:

qawolf flows list --remote                      # errors: --remote requires --env
qawolf flows list --env x                       # errors: --env requires --remote
qawolf flows list                               # local listing unchanged
qawolf flows list --remote --env <id> --json    # calls public.flow.list

Checklist

  • Changes follow the code style of this project
  • Self-review completed
  • Tests added/updated (or not applicable)
  • No breaking changes (or described below)

Breaking changes: flows list --remote now requires --env <env> (it previously listed all team flows unscoped), and --json output emits flowId instead of id, matching public contract terminology. Both are noted in the minor changeset.

An async pino destination races process exit: a command that errors
before the log fd opens (e.g. instant flag validation) crashes pino's
exit-time flushSync with "sonic boom is not ready yet". A sync
destination opens the fd at creation, eliminating the race.
Repoint the remote listing from REST v0 to the public.flow.list
contract from @qawolf/api-contracts 0.2.0, called through
callPublicApi. --env is now required with --remote, --include-drafts
opts into draft flows, and JSON output emits flowId in contract
terminology. The dependency bump makes the generator skip-list
load-bearing: the 0.2.0 tree contains flow.list and must not mint a
duplicate command. bun.lock is intentionally unchanged until 0.2.0 is
on npm; a lockfile commit follows the publish.
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits, uses an approved type and scope, and clearly describes the remote flows environment-scoping change.
Description check ✅ Passed The description includes the required Overview, Testing, and Checklist sections and provides concrete details plus verification steps.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch flows-list-remote-contract

Comment @coderabbitai help to get the list of available commands.

The 0.2.0 publish landed on npm; the lockfile now resolves the
dependency the feature commit already declares.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/shell/logger.ts`:
- Around line 45-48: Update the pino.destination setup in the logger
initialization to synchronously open the log file descriptor while preserving
SonicBoom’s asynchronous write behavior; do not use sync: true for the
destination unless synchronous writes are explicitly intended. Verify the pinned
Pino/SonicBoom API, including descriptor ownership and cleanup, and retain the
existing protection against process-exit flushes occurring before
initialization.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 57f7c671-c10d-4304-8826-c1c7e714fdfb

📥 Commits

Reviewing files that changed from the base of the PR and between 8f603dd and bf956fd.

⛔ Files ignored due to path filters (2)
  • bun.lock is excluded by !**/*.lock
  • src/commands/__snapshots__/help.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (13)
  • .changeset/flows-list-remote-env-scope.md
  • package.json
  • skills/qawolf-cli/SKILL.md
  • src/commands/flows/index.test.ts
  • src/commands/flows/index.ts
  • src/core/messages/flows.ts
  • src/domains/flows/listRemote.test.ts
  • src/domains/flows/listRemote.ts
  • src/shell/logger.ts
  • src/shell/platform/createPlatformClient.testUtils.ts
  • src/shell/platform/createPlatformClient.ts
  • src/shell/platform/getRemoteFlows.test.ts
  • src/shell/platform/getRemoteFlows.ts
💤 Files with no reviewable changes (4)
  • src/shell/platform/getRemoteFlows.ts
  • src/shell/platform/getRemoteFlows.test.ts
  • src/shell/platform/createPlatformClient.testUtils.ts
  • src/shell/platform/createPlatformClient.ts

Comment thread src/shell/logger.ts Outdated
sync: true also made every log write a blocking writeSync; only the
open needed to be synchronous. Open the fd at creation and hand it to
pino, so the exit-time flush can never race the open while writes stay
buffered and asynchronous.
@chajac
Chase J (chajac) marked this pull request as ready for review July 15, 2026 15:28
Base automatically changed from generator-skip-list to main July 15, 2026 17:33
@chajac
Chase J (chajac) merged commit 9f3875d into main Jul 15, 2026
6 checks passed
@chajac
Chase J (chajac) deleted the flows-list-remote-contract branch July 15, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants