Skip to content

feat: Codex OAuth fix, LLM/settings polish, Gmail workspace & enrichment fixes - #1

Open
mohamedelrefaiy wants to merge 1 commit into
mainfrom
sync/open-source-fixes
Open

feat: Codex OAuth fix, LLM/settings polish, Gmail workspace & enrichment fixes#1
mohamedelrefaiy wants to merge 1 commit into
mainfrom
sync/open-source-fixes

Conversation

@mohamedelrefaiy

Copy link
Copy Markdown
Owner

Summary

  • Codex OAuth fix: Keep the app-server session alive until login completes; resolve the codex binary via direct .js entrypoint (works for all npm install methods); augment PATH so codex is found regardless of environment
  • LLM/Settings polish: Surface login-polling state in provider UI; fix provider success states to use darker semantic green; remove redundant page-header renders from Settings pages
  • Gmail workspace: Discuss chip now routes to the inline Chat tab instead of opening the side drawer
  • Enrichment crash fix: Guard against malformed enrichment responses (missing enrichments array) that crashed the Mail tab after ~90s
  • Docs/assets: Updated README screenshots, add DESIGN.md and PRODUCT.md

What's excluded

  • Landing page (landing/) — not included
  • macOS Tauri app changes (src-tauri/) — not included

Test plan

  • Connect a Codex provider in Settings → should complete OAuth without session dying early
  • Open a Gmail thread → click Discuss chip → should switch to Chat tab, not open side drawer
  • Let Mail tab run enrichment for 90s on a slow connection → should not crash React tree
  • Open Settings → provider section should show correct green success state

…ent fixes

- codex.ts: fix OAuth app-server session kept alive until login completes;
  resolve codex binary via direct .js entrypoint (works across all install
  methods, not just shell wrappers); augment PATH so codex is found in any
  server environment
- LLMProviderSettings: surface login-polling state; add start-login API call;
  refresh Codex default model list
- SettingsPage: remove redundant page-header renders; fix provider success
  states to use darker semantic green token
- GmailWorkspace: Discuss chip now routes to inline Chat tab instead of
  opening the side drawer
- useGmailPage + enrichment-batcher: guard against malformed enrichment
  responses (missing enrichments array) that crashed the Mail tab
- server.ts: Codex keepalive session + loopback port allocation for OAuth
- Tailwind: rebuild generated CSS
Copilot AI review requested due to automatic review settings May 20, 2026 18:21

Copilot AI 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.

Pull request overview

This PR improves the Codex provider onboarding/login flow, refines Settings/LLM provider UI states, updates Gmail workspace “Discuss” behavior to route to the inline Chat tab, and hardens enrichment handling to avoid crashes from malformed responses. It also updates documentation/design context artifacts and adjusts packaging metadata.

Changes:

  • Add a server-backed Codex OAuth “start login” endpoint and corresponding frontend flow/state handling.
  • Route Gmail “Discuss” secondary action to the inline Chat tab (with updated tests) and add enrichment null/shape guards.
  • UI polish for provider success states + Settings layout cleanup; docs/design/product updates and packaging tweaks.

Reviewed changes

Copilot reviewed 21 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/tailwind.generated.css Regenerated Tailwind output to support new utility usage in UI tweaks.
src/services/api.ts Adds startCodexLogin() API wrapper for the new Codex OAuth start endpoint.
src/lib/enrichment-batcher.ts Guards against missing/invalid enrichments/failed arrays from enrichment responses.
src/index.css Tweaks --green token for darker/semantic success styling.
src/hooks/useGmailPage.ts Adds null/shape guards when consuming enrichment batch progress.
src/components/SettingsPage.tsx Removes redundant page headers and refactors updates section header/action placement.
src/components/SavedConnectionStatus.tsx Uses semantic green tokens for success/live states instead of accent green.
src/components/ProviderDiagnostics.tsx Aligns diagnostics success styling with semantic green tokens.
src/components/LLMProviderSettings.tsx Implements 2-step Codex OAuth flow (open browser → confirm/poll) and updates success styling.
src/components/gmail/workspace/GmailWorkspace.tsx Routes “Discuss” to inline Chat tab and ensures drawer is closed when Chat tab is active.
src/components/gmail/workspace/tests/GmailWorkspace.test.tsx Updates mocks and asserts Discuss routing behavior; adds coverage for non-discuss chips.
src/App.tsx Adds title mapping for the “suggestions” settings subsection.
src/agent/providers/codex.ts Refactors Codex adapter toward app-server protocol + new model default; introduces server startup changes.
src/agent/providers/tests/codex.test.ts Updates Codex adapter tests to match new RPC flow and mocks.
src/agent/llm-providers-meta.ts Updates Codex model list/default label to GPT-5.x naming.
server.ts Adds Codex OAuth login session manager + /api/codex/login/start endpoint and enhanced poll payload.
scripts/release.sh Switches server bundling entrypoint to server.ts.
README.md Updates product copy, setup/commands, and simplifies architecture/project structure docs.
PRODUCT.md Adds product/design context document.
DESIGN.md Adds a detailed design system document and tokens/guidelines.
package.json Adds bin entry and changes version.
.gitignore Ignores additional local agent/tooling directories.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +125 to 135

const codexBin = CODEX_PATHS.find((p) => {
try {
execFileSync(p, ['--version'], { stdio: 'ignore', env });
return true;
} catch {
return false;
}
}) ?? 'codex';

const proc = spawn(codexBin, ['app-server', '--listen', `ws://127.0.0.1:${port}`], {
Comment on lines +74 to 76
function resolveCodexCommand(env: NodeJS.ProcessEnv): { bin: string; leadingArgs: string[] } {
const { existsSync } = require('fs') as typeof import('fs');

Comment on lines 221 to +225
async complete(
messages: readonly ChatMessage[],
options: CompletionOptions = {},
): Promise<CompletionResponse> {
const { signal, tools } = options;
const { signal } = options;
Comment thread server.ts
Comment on lines +14 to 20
import WebSocket from 'ws';
import http from 'http';
import https from 'https';
import net from 'net';
import { randomUUID } from 'crypto';
import dotenv from 'dotenv';
import { handleChat, executeApprovedAction } from './src/agent/chat.js';
Comment thread package.json
"name": "flowspace",
"private": true,
"version": "1.0.2",
"version": "0.0.1",
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