Skip to content

Add factory init command#191

Merged
willwashburn merged 2 commits into
mainfrom
codex/factory-init
Jul 22, 2026
Merged

Add factory init command#191
willwashburn merged 2 commits into
mainfrom
codex/factory-init

Conversation

@willwashburn

@willwashburn willwashburn commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • add factory init [owner/repo] to configure the current checkout for GitHub-native issue dispatch
  • verify local Relay dependencies, the active workspace, local mount, and connected GitHub repository before creating configuration
  • add safety coverage for missing dependencies, missing GitHub connectivity, and existing config files

Why

Factory previously required manually creating factory.config.json and knowing the Relay/GitHub setup sequence. The new command gives users one entry point and stops with actionable guidance without writing partial configuration.

Validation

  • git diff --check
  • Added focused unit tests for init configuration and CLI parsing
  • Full test/build execution is currently blocked locally because the locked npm dependencies cannot all be fetched from the registry in this environment.

Summary by cubic

Add factory init [owner/repo] to set up the current checkout for GitHub‑native issue dispatch. It now ensures the Relay local mount is running before validating GitHub connectivity, then writes a safe, minimal factory.config.json.

  • New Features

    • factory init [owner/repo] with optional --workspace <id>; derives repo from origin if omitted.
    • Ensures prerequisites (agent-relay, relayfile), starts the local mount, and verifies the GitHub repo; refuses to overwrite an existing config.
    • Writes minimal config and prints next steps; CLI help and README updated; unit tests added.
  • Bug Fixes

    • Fixed mount setup to start the local Relay mount before GitHub checks and to fail clearly when a mount cannot be started.

Written for commit 03034a0. Summary will update on new commits.

Review in cubic

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@willwashburn, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 82cc6983-03f3-4fc1-905a-bd74f561a537

📥 Commits

Reviewing files that changed from the base of the PR and between 2079ae0 and 03034a0.

📒 Files selected for processing (5)
  • README.md
  • src/cli/fleet.test.ts
  • src/cli/fleet.ts
  • src/cli/init.test.ts
  • src/cli/init.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/factory-init

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@willwashburn
willwashburn marked this pull request as ready for review July 22, 2026 14:06
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48a48ab1a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/init.ts Outdated
Comment on lines +65 to +67
out.write(`Checking ${repo} in Relay workspace ${workspaceId}…\n`)
await (options.ensureLocalMount ?? ensureLocalMount)(workspaceId, cwd, {
acceptableWorkspaceIds: 'cloudWorkspaceId' in workspace && workspace.cloudWorkspaceId ? [workspace.cloudWorkspaceId] : undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Start the SDK mount instead of calling preflight directly

When factory init is run in a fresh checkout without an existing .integrations/.relay/state.json, this call reaches ensureLocalMount from local-mount-preflight, whose contract requires options.startMount; because this object does not provide it, the command fails with options.startMount is not a function before it can verify GitHub or create the config. Use the Relayfile mount client’s ensureLocalMount wrapper (or pass a real startMount callback) so init can bootstrap the local mount it is meant to set up.

Useful? React with 👍 / 👎.

@willwashburn
willwashburn merged commit 88a9cea into main Jul 22, 2026
7 checks passed
@willwashburn
willwashburn deleted the codex/factory-init branch July 22, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant