Skip to content

Reuse onboarding flows in Settings, fix AI provider requests, classify business conversations - #74

Merged
rcsarv merged 2 commits into
mainfrom
codex/settings-onboarding-openai-fix
Oct 7, 2026
Merged

rcsarv merged 2 commits into
mainfrom
codex/settings-onboarding-openai-fix

Conversation

@rcsarv

@rcsarv rcsarv commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Two commits from the Codex session.

d412b5a feat(settings): reuse onboarding flows and fix AI provider requests

  • Settings → Add account / AI providers now use the same provider, connection and model steps as onboarding. Existing account and provider identities, default selections and cancellation behave as before. Keyboard focus returns after nested confirmations (new ConfirmDialog / SetupDialog / modal-focus).
  • AI provider requests: Sarv-only Chat Completions parameters are sent only to Sarv, through the new shared helper buildAIChatRequestOptions (listed in CLAUDE.md). API failures now name the provider that actually failed.
  • Regression tests for request payloads, OAuth retries, multi-account setup and credential persistence failures.

8fa31ee fix(ai): distinguish business conversations from promotions

  • Requested quotes, customer questions, negotiations and internal approvals are told apart from promotional outreach. Categorization uses outgoing correspondence as context and applies the same guidance to automatic and manual processing.
  • Category lists refresh their membership after background classification.
  • Migration 104 (main ends at 103, so no number clash), with migration, prompt-seeding and business-conversation tests.

Before merging

  • Changelog gap: [Unreleased] has an entry for 8fa31ee only. The Settings rework and the provider-request fix in d412b5a are user-facing, so they need an entry before the next release, or the release notes will miss them.

Verification

  • GitHub CI, clean runner: unit and integration tests (every package), type-check, lint, the renderer bundle guard and CodeQL all pass.
  • Dependency scan fails, but not because of this PR. A critical shell-quote advisory (< 1.11.0, command injection in quote()) was published after main's last run, and main fails the same check. The fix is in its own PR; re-run this check once that merges.
  • Locally: frozen install, type-check and lint pass. The test run on this machine isn't usable as evidence: it was under load average ~180 from a long-running Docker VM, and each run failed a different set of wall-clock-sensitive storage-node tests (migration idempotency at its 60 s limit, body-relocation pacing, read-model catchUp). The clean CI run passes all of them.

🤖 Generated with Claude Code

rcsarv added 2 commits October 7, 2026 10:30
Use the onboarding provider, connection and model steps for adding email
accounts and AI providers in Settings. Preserve existing account and provider
identities, default selections, and cancellation behavior. Restore keyboard
focus after nested confirmations.

Restrict Sarv-only Chat Completions parameters to Sarv requests and label API
failures with their actual provider. Add regressions for request payloads,
OAuth retries, multi-account setup and credential persistence failures.

Validation: 12,001 tests passed, with 12 existing opt-in tests skipped.
Workspace TypeScript and lint checks passed.
it('restores the saved nondefault region and nonrecommended backend before listing models', async () => {
vi.mocked(loadZoneSelection).mockResolvedValue({ zones, zoneCode: 'default' });
vi.mocked(listCaiProviders).mockResolvedValue(backends);
vi.mocked(listCaiModels).mockImplementation(async (_base, _email, backend) => backend === 'saved-backend' ? [{ code: 'saved-model', display_name: 'Saved model', provider_code: backend || '' }] : [{ code: 'recommended-model', provider_code: backend || '' }]);
// Legacy entries whose friendly name changed still restore the backend that has their exact model.
it('searches catalogs for a legacy saved model when its old backend name does not match', async () => {
vi.mocked(listCaiProviders).mockResolvedValue(backends);
vi.mocked(listCaiModels).mockImplementation(async (_base, _email, backend) => backend === 'saved-backend' ? [{ code: 'saved-model', provider_code: backend || '' }] : [{ code: 'different-model', provider_code: backend || '' }]);
},
};
const store = createStore<any>()((set, get, api) => ({
...createEmailsSlice(set, get, api),
};
const store = createStore<any>()((set, get, api) => ({
...createEmailsSlice(set, get, api),
...createSearchAISlice(set, get, api),
@rcsarv
rcsarv merged commit adb39d6 into main Oct 7, 2026
6 of 7 checks passed
@rcsarv
rcsarv deleted the codex/settings-onboarding-openai-fix branch October 7, 2026 19:39
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.

2 participants