feat: Codex OAuth fix, LLM/settings polish, Gmail workspace & enrichment fixes - #1
Open
mohamedelrefaiy wants to merge 1 commit into
Open
feat: Codex OAuth fix, LLM/settings polish, Gmail workspace & enrichment fixes#1mohamedelrefaiy wants to merge 1 commit into
mohamedelrefaiy wants to merge 1 commit into
Conversation
…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
There was a problem hiding this comment.
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 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'; |
| "name": "flowspace", | ||
| "private": true, | ||
| "version": "1.0.2", | ||
| "version": "0.0.1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.jsentrypoint (works for all npm install methods); augment PATH so codex is found regardless of environmentenrichmentsarray) that crashed the Mail tab after ~90sWhat's excluded
landing/) — not includedsrc-tauri/) — not includedTest plan