Skip to content

feat(agent): merge API keys and Local API into one API section - #1446

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-apiunify-maple
Nov 4, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-apiunify-maple

Conversation

@AnthonyRonning

@AnthonyRonning AnthonyRonning commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Settings has one API section instead of separate API keys and Local API entries, laid out as three cards: API credits, Local API, API keys.

The two belong together because the Local API is how other apps use these keys. The backend's /v1 routes only accept Maple's encrypted transport, so a key on its own can't reach them from an ordinary client.

A wrong instruction is gone

The old keys pane said keys "work with any OpenAI-compatible client at https://enclave…/v1". They don't. With the same real key against a Local stack:

Path Result
Directly at the backend, as the old copy said 400
Through the Local API 200, with the real model list

The page no longer says this, and docs/local-api.md now explains why.

Behavior to review

  • The Local API card stays on every plan. Free accounts see the upgrade card in place of credits and keys, but keep the Local API controls. A key can belong to another account, and a listener left on after a downgrade still has to be turnable off.
  • Creating a key scrolls its card into view. Testing showed the one-time key appearing below the fold. The Local API card now sits above the keys so a long key list can't push it off-screen, which makes this scroll necessary.
  • Sidebar and code: Section::ApiKeys is now Section::Api and Section::LocalApi is gone. Section isn't persisted. Editors (feat(agent): replace the ACP settings form with editor setup #1444) stays right after it.

Cleanup

  • Keys are rows in one card, with a quiet delete icon that becomes Cancel and Confirm delete, instead of a card and a Delete button each.
  • Local API state is a badge plus one line beside the switch. Resume and Retry sit next to the switch.
  • Save port appears only for a different valid port, and an invalid port is reported on its row as you type. Refresh status appears only to recover from a failed read or update.
  • The setup notes and endpoint card are now a short footnote. "1 active request" is singular.
  • The raw backticks and the -- that rendered as a dash in the old intro are gone.
  • Every control takes Tab in page order, plus Enter and Space. The keys pane's buttons weren't tab stops before.

widgets::card_stack is the new shared piece. activates loses its feature gate because the keys card needs it in every desktop build, and section_title's doc comment is back on section_title.

Validation

Run on macOS after rebasing onto current master, without the workspace env sourced.

Check Result
cargo fmt --check, just ci-lint, just ci-extra, just lane repo pass
cargo check --no-default-features --features desktop (no proxy) pass
cargo test --workspace --no-fail-fast 2,539 pass, 1 fails

The failure is maple-agent-updater's reads_native_release_tar_format_and_preserves_bundle_modes, a bsdtar issue on this host. This PR doesn't touch that crate. The pre-commit hook would stop on it, so the commit ran with MAPLE_HOOK_ONLY=repo after running the Agent checks separately.

Live, in the real debug app against a Local stack with a Pro fixture: one API sidebar entry, creating keys through the UI, the one-time reveal and scroll, turning the listener on, the status badge and port lock, the delete confirm step, quitting, and resuming On after relaunch.

Not exercised live:

  • That pass predates the rebase onto feat(agent): replace the ACP settings form with editor setup #1444 and Fix Debian normalization test on macOS #1439, the stronger dividers and the shorter routes line. Those are covered by tests or offscreen renders only.
  • Free plan, Paused, Could not start, and the port Save button were checked with unit tests and offscreen renders of the real pane using sample data.
  • Actually deleting a key: I stopped at Confirm delete. The delete path itself didn't change.
  • Tab traversal: Application Vim target order has tests, but Tab and Enter/Space weren't pressed by hand.

Likely conflicts

The i18n work in #1372 and the draft "last used" column in #1140 both touch these strings and the key row, so whichever lands second will need a small rebase.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Other applications reach Maple through the local endpoint with an account
key: the backend's /v1 routes only accept Maple's encrypted transport. Keys
and the listener are one feature, so Settings now has one API section with
three cards: API credits, Local API and API keys.

The keys pane told people to point any OpenAI-compatible client at the
hosted URL. That was wrong: a real key gets 400 there and 200 through the
listener. Remove the claim, and say so in the Local API doc.

The Local API card stays on every plan. A key can belong to another account,
and a listener left on after a downgrade must still be able to turn off.

Creating a key scrolls its card into view. It can only be copied once, and
below a taller page it would otherwise appear past the fold.

Clean up the page:
- Keys are rows in one card, with a quiet delete icon that becomes Cancel and
  Confirm delete, instead of a card and a Delete button each.
- Local API state is a badge and one line beside the switch. Resume and Retry
  sit next to the switch instead of on a row of their own.
- Save port appears only for a different valid port, and an invalid one is
  reported on its row as it is typed. Refresh status appears only to recover
  from a failed read or update.
- Fold the setup notes and endpoint list into a short footnote, and count one
  active request correctly.
- Every control on the page takes Tab, in page order, plus Enter and Space.

widgets::card_stack holds the rows. activates is no longer feature-gated,
since the keys card uses it in every desktop build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnthonyRonning
AnthonyRonning merged commit 22163fd into master Nov 4, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-apiunify-maple branch November 4, 2026 09:27
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