feat(flows): scope flows list --remote by environment via public API#1392
Merged
Conversation
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.
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The 0.2.0 publish landed on npm; the lockfile now resolves the dependency the feature commit already declares.
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (2)
bun.lockis excluded by!**/*.locksrc/commands/__snapshots__/help.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (13)
.changeset/flows-list-remote-env-scope.mdpackage.jsonskills/qawolf-cli/SKILL.mdsrc/commands/flows/index.test.tssrc/commands/flows/index.tssrc/core/messages/flows.tssrc/domains/flows/listRemote.test.tssrc/domains/flows/listRemote.tssrc/shell/logger.tssrc/shell/platform/createPlatformClient.testUtils.tssrc/shell/platform/createPlatformClient.tssrc/shell/platform/getRemoteFlows.test.tssrc/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
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.
Chase J (chajac)
marked this pull request as ready for review
July 15, 2026 15:28
Mateus Zitelli (MateusZitelli)
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1391.
Overview of Changes
flows list --remotepreviously called REST v0 (GET /api/v0/flows), which cannot scope by environment or include drafts. It now calls thepublic.flow.listtRPC endpoint throughcallPublicApi, using the contract from@qawolf/api-contracts@0.2.0directly.The command gains
--env(required with--remote) and--include-drafts. Invalid flag combinations (--remotewithout--env;--envor--include-draftswithout--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 timeflushSyncwith“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 buildManual smoke:
Checklist
Breaking changes:
flows list --remotenow requires--env <env>(it previously listed all team flows unscoped), and--jsonoutput emitsflowIdinstead ofid, matching public contract terminology. Both are noted in the minor changeset.