Skip to content

Fix Droid API-key recovery instructions - #5065

Open
vincent-peng wants to merge 1 commit into
steipete:mainfrom
vincent-peng:codex/factory-api-key-guidance
Open

vincent-peng wants to merge 1 commit into
steipete:mainfrom
vincent-peng:codex/factory-api-key-guidance

Conversation

@vincent-peng

Copy link
Copy Markdown
Contributor

Summary

Droid's missing-API-key message recommends a setter command without its required input option and assumes the legacy config path. The message now explicitly says to pipe a key into the stdin setter, and the Factory docs describe the resolved configuration file.

A portable regression extracts the command from the displayed error and resolves the real registered CLI action. Authentication, source selection, fallback, and config-writing behavior are unchanged.

Behavior proof

Checked source-built macOS CLI executables at base 7447bc77c2497323d9c41e40164ce705533493c8 and head be435d60bb8f485d5c2d2fe3ea45624d4e07e6e6. Both setter invocations received the same nonempty synthetic input on stdin.

Build Command extracted from the missing-key message Result
Base codexbar config set-api-key --provider factory Exit 1: Missing API key. Pass --api-key <key> or pipe it with --stdin.
Head codexbar config set-api-key --provider factory --stdin Exit 0; saves the key in the selected config.

Controls cover existing default XDG config, custom XDG_CONFIG_HOME, CODEXBAR_CONFIG, and legacy-only installs. A truly fresh usage read creates no config, and a subsequently created legacy file remains supported. Saving preserves the configured Web source and session accounts, enables by default, honors --no-enable, rejects blank input before writing, and produces private config-file permissions.

All command checks use synthetic homes, files, and key values with network and Keychain access blocked. They exercise local configuration storage without provider requests.

Validation

  • ./Scripts/test_fast.sh --filter 'FactoryAPIKeyGuidanceTests|FactorySettingsReaderTests|FactoryAPIFetchStrategyTests|FactoryAPIKeyProbeFetchTests|CLIConfigCommandTests|ConfigValidationTests' --jobs 4: 74 tests passed across six suites. The new regression failed on the base message at the missing stdin flag.
  • make check with Python 3.14.
  • node Scripts/check-documentation-links.mjs.
  • SwiftFormat and strict SwiftLint on the touched Swift files.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T00:01:41.262062Z be435d6 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR adds the required stdin flag to Droid’s API-key recovery command and documents the resolved configuration location.

Example: Pipe a nonempty Factory API key into the command quoted by the missing-key message.

  • Before: codexbar config set-api-key --provider factory ignores stdin and exits with “Missing API key.”
  • After: codexbar config set-api-key --provider factory --stdin reads the piped key and saves it to the resolved config.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal correction with relevant executable before/after evidence and a regression that connects displayed guidance to the registered CLI command.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body supplies before/after results from source-built macOS CLI executables at the pinned revisions: the command extracted from FactoryStatusProbeError rejects synthetic piped input on base and stores it successfully with --stdin on head, with isolated config-location and preservation controls.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users following Droid’s missing-key instructions receive another missing-key error or are directed to a config location their installation does not use.
Reason: The patch restores the existing recovery contract with no new option, default, authentication behavior, or persistence mechanism.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes demonstrably unusable recovery guidance with a small, focused change; no introduced correctness or security defects were found.

Priority: P2
Reviewed head: be435d60bb8f485d5c2d2fe3ea45624d4e07e6e6

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Factory provider emits a missing-key error during explicit API usage; its recovery guidance directs users to the existing CLI setter, which reads stdin and writes through the shared configuration store.

flowchart TD
A[Factory API usage] --> B[Missing key message]
B --> C[CLI stdin setter]
C --> D[Resolved configuration file]
D --> E[Subsequent provider usage]
Loading

Technical review

Best possible solution:

Land the focused guidance correction using the existing stdin setter and shared config resolver.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main guidance omits both accepted input options, and the setter source necessarily rejects that command even with piped input; the contributor also reports matching base/head executable results.

Is this the best way to solve the issue?

Yes: adding the existing --stdin flag and linking the authoritative config documentation fixes the misleading guidance without changing credential handling or duplicating configuration ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7447bc77c249.

Provenance checked

  • Factory missing-key message and API-key documentation keeps the original intent (121e9ca: Add Factory API-key authentication with explicit API mode, compatible Auto behavior, and recoverable browser fallback.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Akshay: Raw commit 121e9ca adds docs/factory.md:19 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 121e9ca1db82; files: docs/factory.md)
  • Peter Steinberger: Raw commit 431e8b7 adds docs/factory.md:19 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 431e8b79a730; files: docs/factory.md)
  • Vincent Peng: Raw commit 9ebd900 adds docs/factory.md:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9ebd90017f2c; files: docs/factory.md)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The incorrect command frustrates a specific CLI recovery workflow, while existing environment-variable and Settings paths remain available.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The incorrect command frustrates a specific CLI recovery workflow, while existing environment-variable and Settings paths remain available.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 11, 2026, 7:12 PM ET / November 12, 2026, 00:12 UTC.

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

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant