This repository tracks 21st-dev/1code with additional Windows fixes.
git remote add upstream https://github.com/21st-dev/1code.gitgit fetch upstream
git checkout main
git merge upstream/main
git push origin mainUse the helper script:
npm run release:portableThis will:
- Fetch upstream
- Merge upstream/main into current main
- Build + package portable
- Tag and push the release
- If you have local fixes, make sure they are committed before syncing.
- If conflicts appear, resolve them and continue with the merge before releasing.
After taking upstream as base, re-apply the following (upstream does not include them):
src/main/lib/trpc/routers/claude.ts— CWD resolution (path.resolve(os.homedir(), input.cwd)for relative paths); UNC retry (paths starting with\\: retryfs.statonce after 500ms); CWD sanitization for session path (input.cwd.replace(/[/\\\\.:]/g, "-")); worktree fallback (chat → project →project.pathfrom DB when stat fails); PROCESS_CRASH diagnostic (when no stderr, spawn binary--versionwith same cwd/env, capture stdout/stderr, setdiagnosticOutput);import { spawn } from "node:child_process".src/main/lib/claude/transform.ts— Token usage inmsg.type === "result":usage/usage_info,modelUsage(sum over models), fallbacks forinputTokens/outputTokens, andinputTokens ?? 0,outputTokens ?? 0,totalTokens.scripts/download-claude-binary.mjs— On 404: explicit error andif (fs.existsSync(destPath)) fs.unlinkSync(destPath)beforereject. On non-200 and on redirect/stream errors:existsSyncbeforeunlinkSync.src/main/index.ts— Auth server started after single-instance lock and app ready;reuseAddress: trueon listen; on EADDRINUSE show dialog and quit.src/main/lib/trpc/routers/projects.ts— openFolder: usegetWindowForDialog(ctx); on Windows dialog without parent +setAlwaysOnTop(true, "floating"); import windowManager directly.src/renderer/features/agents/lib/ipc-chat-transport.ts— errorDetails: putdiagnosticOutputfirst when present; PROCESS_CRASH toast 20s + description hint (Copy Error, run 1Code from terminal for main logs).
Build: Use npm run package (package-windows.mjs) for Windows unpacked so better-sqlite3 is copied correctly; avoid npm run package:win for unpacked.
Already in upstream (no re-apply): Windows frame preference, claude.exe in PLATFORMS["win32-x64"].binary, app:isPackaged.