Skip to content

Add multi-backend fixer support (Claude / Codex / Cursor) - #12

Open
Senna46 wants to merge 4 commits into
mainfrom
feature/multi-backend-fixer
Open

Add multi-backend fixer support (Claude / Codex / Cursor)#12
Senna46 wants to merge 4 commits into
mainfrom
feature/multi-backend-fixer

Conversation

@Senna46

@Senna46 Senna46 commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Abstract the fix backend behind a BugFixer interface so Fixooly can dispatch to Claude CLI, OpenAI Codex CLI, or Cursor CLI depending on the new required AUTOFIX_FIXER environment variable.
  • Cursor is the recommended default for daemon use because the Cursor Pro Auto+Composer pool has no 5-hour rolling rate limit, unlike Codex on ChatGPT Plus/Pro. The plan in .plans/multi-backend-fixer.plan.md walks through the comparison.
  • Centralise child-process plumbing (timeout, stdin, bounded stdout) in src/fixers/spawnRunner.ts and the COMMIT_MSG: / FIX_DETAIL: marker parsing in src/fixers/outputParser.ts. The parser now also understands Cursor's JSON output and Codex's JSONL event stream.
  • FixGenerator keeps the cloning / commit / push responsibilities and receives the active BugFixer via constructor injection. main.ts instantiates the right fixer through createFixer() and delegates verifyPrerequisites() to the backend itself.

Files

  • New: src/fixers/{types,factory,claudeFixer,codexFixer,cursorFixer,spawnRunner,outputParser}.ts
  • Modified: src/types.ts, src/config.ts, src/fixGenerator.ts, src/main.ts
  • Docs: README.md, .env.example, CLAUDE.md, AGENTS.md

Test plan

  • npm run typecheck -- zero errors
  • npm run build -- dist/ produced without errors
  • Smoke test with AUTOFIX_FIXER=cursor against a real PR (deferred until the new Cursor Pro account is provisioned)
  • Smoke test with AUTOFIX_FIXER=codex against a real PR (deferred until ChatGPT Plus is provisioned)
  • Regression test with AUTOFIX_FIXER=claude against the existing setup (manual run on the daemon host)

Out of scope

  • Live runtime testing of the Cursor / Codex backends (will be validated by the user after subscriptions are provisioned).
  • Automatic fallback between backends when one is rate-limited.

Closes #11


Note

Medium Risk
Breaking config (mandatory AUTOFIX_FIXER) and new untested CLI integrations change how fixes are applied and committed to PR branches; misconfiguration or parser/CLI mismatches could fail silently or produce bad commits.

Overview
This PR replaces the hard-coded Claude claude -p path with a pluggable BugFixer layer so the daemon can run fixes through Cursor, Codex, or Claude CLIs.

Configuration: AUTOFIX_FIXER is now required (no default)—claude / codex / cursor—with optional per-backend model overrides (AUTOFIX_CURSOR_MODEL, AUTOFIX_CODEX_MODEL, AUTOFIX_CLAUDE_MODEL) and documented API keys in .env.example. Existing deployments must set AUTOFIX_FIXER explicitly (e.g. claude to keep prior behavior).

Code: New src/fixers/ modules (types, factory, three fixer implementations, spawnRunner, outputParser) own CLI invocation, timeouts, and parsing of COMMIT_MSG: / FIX_DETAIL: across plain text, JSON, and JSONL. FixGenerator only clones, builds the prompt, calls fixer.generateFix, then commits/pushes; main.ts wires createFixer(config) and delegates prerequisite checks to the selected backend.

Docs: README, AGENTS.md, CLAUDE.md, and a plan file describe backend selection (Cursor recommended for daemons) and the updated architecture.

Reviewed by Cursor Bugbot for commit 6729e01. Bugbot is set up for automated code reviews on this repo. Configure here.

Senna46 added 3 commits June 5, 2026 12:23
Document the design for abstracting the Claude CLI backend behind a
BugFixer interface so Fixooly can dispatch to Claude, Codex, or Cursor
CLIs via the AUTOFIX_FIXER environment variable.
Introduce a BugFixer abstraction so Fixooly can dispatch fix generation
to any of three CLIs at runtime, selected via the new AUTOFIX_FIXER
environment variable (required, no default):

- claude -- existing claude -p flow, moved into src/fixers/claudeFixer.ts
- codex  -- new codex exec backend with --sandbox workspace-write
- cursor -- new agent -p backend with --force --trust --workspace, the
            recommended default for daemon use (no per-hour rate limit
            on the Cursor Pro Auto+Composer pool)

The child-process timeout, signal handling, stdin piping, and bounded
stdout capture are now centralised in src/fixers/spawnRunner.ts, and
the COMMIT_MSG / FIX_DETAIL marker parsing is centralised in
src/fixers/outputParser.ts (which also understands Cursor's JSON and
Codex's JSONL event streams).

FixGenerator no longer references claude directly; it accepts a
BugFixer through its constructor and delegates fix generation to it.
main.ts wires this up through createFixer() and delegates the
backend-specific prerequisite checks to the fixer itself.
Update the README, .env.example, and the two agent guides (CLAUDE.md /
AGENTS.md) to reflect the new pluggable BugFixer architecture:

- README gets a "Backend Selection" section that compares the three
  backends on subscription, headless auth, and rate limits, with
  install + auth instructions for each. The architecture mermaid is
  redrawn around the dispatched BugFixer instead of "claude -p", and
  the module overview lists the new src/fixers/* files.
- .env.example is reorganised by backend and lists the required env
  vars per fixer (CURSOR_API_KEY / CODEX_API_KEY / Claude OAuth).
  AUTOFIX_FIXER is documented as required with no default.
- CLAUDE.md / AGENTS.md describe the BugFixer interface, the new
  module dependency graph, and how to add a new backend without
  touching fixGenerator.ts.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ff70199. Configure here.

Comment thread src/fixers/outputParser.ts
- Codex JSONL message not extracted

Applied via Fixooly
@senna-fixooly

senna-fixooly Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Fixooly committed fixes for 1 bug(s). (6729e01cb4)

  • ✅ Fixed: Codex JSONL message not extracted
    • Added a branch in extractMessageFromJson that unwraps obj.item and returns itemObj.text when itemObj.type is "agent_message", so the current codex exec --json item.completed events yield the assistant reply for COMMIT_MSG/FIX_DETAIL marker parsing

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.

Add multi-backend fixer support (Claude / Codex / Cursor)

1 participant