Merge pull request #400 from AutoMaker-Org/feat/codex-usage

feat: improve codex plan and usage detection
This commit is contained in:
Shirone
2026-01-10 15:29:33 +00:00
committed by GitHub
19 changed files with 1134 additions and 463 deletions

View File

@@ -68,8 +68,9 @@ function RootLayoutContent() {
getEffectiveTheme,
skipSandboxWarning,
setSkipSandboxWarning,
fetchCodexModels,
} = useAppStore();
const { setupComplete } = useSetupStore();
const { setupComplete, codexCliStatus } = useSetupStore();
const navigate = useNavigate();
const [isMounted, setIsMounted] = useState(false);
const [streamerPanelOpen, setStreamerPanelOpen] = useState(false);
@@ -431,6 +432,20 @@ function RootLayoutContent() {
}
}, [isMounted, currentProject, location.pathname, navigate]);
// Bootstrap Codex models on app startup (after auth completes)
useEffect(() => {
// Only fetch if authenticated and Codex CLI is available
if (!authChecked || !isAuthenticated) return;
const isCodexAvailable = codexCliStatus?.installed && codexCliStatus?.auth?.authenticated;
if (!isCodexAvailable) return;
// Fetch models in the background
fetchCodexModels().catch((error) => {
logger.warn('Failed to bootstrap Codex models:', error);
});
}, [authChecked, isAuthenticated, codexCliStatus, fetchCodexModels]);
// Apply theme class to document - use deferred value to avoid blocking UI
useEffect(() => {
const root = document.documentElement;