fabro/lib
brynary-fabro[bot] fd5cde2719
Fix: Add OAuth callback URLs to CLI-generated GitHub App manifest (#105)
This PR fixes GitHub issue #97 where `fabro install` creates a GitHub
App that passes `fabro doctor` but fails during OAuth login in
`fabro-web` because the CLI-generated manifest is missing
`callback_urls` and `setup_url` fields. Without these fields, GitHub
rejects the OAuth flow with a "must be configured with a callback URL"
error, even though the web setup flow (`setup.tsx`) already includes
them correctly.

The fix extracts manifest construction into a standalone
`build_github_app_manifest` helper and adds the missing `callback_urls`
and `setup_url` fields, mirroring what the web setup flow already
provides. A new `--web-url` flag (defaulting to `http://localhost:5173`)
is added to the `Install` command so users can specify their web UI base
URL, which is then threaded through `run_install` and `setup_github_app`
to construct the correct OAuth callback endpoints.

A unit test is included to verify that the generated manifest contains
the expected `callback_urls` and `setup_url` values for a given
`web_url`.

### Fabro Details

<details>
<summary>Ran 9 stages in 17m 47s for $1.56</summary>

| Stage | Duration | Cost | Retries |
|---|---|---|---|
| start | 0s | – | 0 |
| toolchain | 0s | – | 0 |
| preflight_compile | 1m 11s | – | 0 |
| preflight_lint | 14s | – | 0 |
| implement | 6m 32s | $0.64 | 1 |
| simplify_opus | 0s | – | 3 |
| simplify_gpt | 5m 42s | $0.92 | 0 |
| verify | 1m 21s | – | 0 |
| fmt | 1s | – | 0 |
| **Total** | **17m 47s** | **$1.56** | **4** |

</details>

<details>
<summary>Ran <code>ImplementAndSimplify.fabro</code> (12 nodes and 15
edges)</summary>

```dot
digraph ImplementAndSimplify {
    graph [
        goal="Implement and simplify",
        model_stylesheet="
            * { backend: api; model: claude-opus-4-6;}
        "
    ]
    rankdir=LR

    start [shape=Mdiamond, label="Start"]
    exit  [shape=Msquare, label="Exit"]

    toolchain         [label="Toolchain", shape=parallelogram, script="command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1", max_retries=0]
    preflight_compile [label="Preflight Compile", shape=parallelogram, script="cargo check -q --workspace 2>&1", max_retries=0]
    preflight_lint    [label="Preflight Lint", shape=parallelogram, script="cargo clippy -q --workspace -- -D warnings 2>&1", max_retries=0]
    fix_lints         [label="Fix Lints", prompt="The preflight lint step failed. Read the build output from context and fix all clippy lint warnings.", max_visits=3]
    implement         [label="Implement", prompt="Read the plan file referenced in the goal and implement every step. Make all the code changes described in the plan. Use red/green TDD."]
    simplify_opus     [label="Simplify (Opus)", prompt="@prompts/simplify.md"]
    simplify_gpt      [label="Simplify (GPT-54)", prompt="@prompts/simplify.md", model="gpt-54"]
    verify            [label="Verify", shape=parallelogram, script="cargo clippy -q --workspace -- -D warnings 2>&1 && cargo nextest run --cargo-quiet --workspace --status-level fail 2>&1", goal_gate=true, retry_target="fixup"]
    fixup             [label="Fixup", prompt="The verify step failed. Read the build output from context and fix all clippy lint warnings and test failures.", max_visits=3]
    fmt               [label="Format", shape=parallelogram, script="cargo fmt --all 2>&1", max_retries=0]

    start -> toolchain
    toolchain -> preflight_compile [condition="outcome=success"]
    toolchain -> exit
    preflight_compile -> preflight_lint [condition="outcome=success"]
    preflight_compile -> exit
    preflight_lint -> implement [condition="outcome=success"]
    preflight_lint -> fix_lints
    fix_lints -> preflight_lint
    implement -> simplify_opus -> simplify_gpt -> verify
    verify -> fmt   [condition="outcome=success"]
    verify -> fixup
    fixup -> verify
    fmt -> exit
}

```

</details>

⚒️ Generated with [Fabro](https://fabro.sh)

---------

Co-authored-by: Fabro <noreply@fabro.sh>
Co-authored-by: Bryan Helmkamp <bryan@brynary.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 13:39:39 -04:00
..
crates Fix: Add OAuth callback URLs to CLI-generated GitHub App manifest (#105) 2026-03-19 13:39:39 -04:00
packages/fabro-api-client Designate retros as experimental, disable by default via [features] flag 2026-03-15 20:36:32 -04:00