feat: session lock & recovery, web interface, ads optimization, stoneage skills, themes and statusline - #18
Open
mat-dgruber wants to merge 47 commits into
Open
feat: session lock & recovery, web interface, ads optimization, stoneage skills, themes and statusline#18mat-dgruber wants to merge 47 commits into
mat-dgruber wants to merge 47 commits into
Conversation
…hangeDetector Switch change-detector to native FS events (no more Bun polling), add a 500ms debounce window per SettingSource with generation cancellation so concurrent edits collapse into one fanout, and extract every external side effect through a default-dependencies object that tests can override. Why: Bun fs.watch deadlock forced chokidar usePolling which causes lag and disk churn on a CLI that reacts to settings edits per keystroke. Chokidar on Darwin uses fsevents which is reliable and faster. Deps shape also lets us swap the watcher in unit tests without monkey-patching. How to apply: when adding new side effects inside changeDetector, route them through dependencies.* rather than importing the implementation directly so they remain test-overridable.
…zed, gruvbox, synthwave, cyberpunk) + themeOverrides setting Extends THEME_NAMES and getTheme() with seven new palettes derived from darkTheme/lightTheme: dracula, nord, monokai, solarized-dark, solarized-light, gruvbox, synthwave84, cyberpunk. Also threads a new optional record through SettingsSchema and applies it on top of the resolved palette inside getTheme() so users can tweak colors without forking the theme module. ThemePicker exposes the new options in the picker. Why: existing themes cover binary light/dark and colorblind variants but not developer-favorite palettes; users wanted quick swap without custom build steps. themeOverrides unlocks ad-hoc color tweaks via settings without code changes. How to apply: add new palettes by appending to THEME_NAMES, defining a matching const Theme, and adding a case in getTheme().
…sume generateCommandSuggestions now tight-matches when the input is one of '/ads ', '/config ' or '/resume '. /ads completes to on/off, /config to 8 known keys, and /resume scans the project session directory for .jsonl files, surfacing the latest 10 with their firstPrompt as desc. Why: typing '/' alone only listed top-level commands, leaving users guessing arg names. Tab-completing the first arg dramatically lowers friction for the three highest-traffic config commands. How to apply: keep this branch block at the top of generateCommandSuggestions; add new '/cmd ' branches here so they short-circuit the generic Fuse lookup.
Adds src/services/api/offlineState.ts: a DNS probe against google.com with a 2s timeout that sets an in-memory offline flag, plus a CLAUDE_CODE_OFFLINE=1 override for tests/deterministic runs. QueryEngine.submitMessage now awaits checkInternetConnection() before calling the underlying stream; when offline it emits a single assistant warning + a synthetic 'result' with stop_reason 'offline' and exits, so the CLI no longer hangs or floods errors when the user has no network. Why: the CLI was reaching the Anthropic SDK on every prompt and producing noisy axios errors when wifi was off. Surfacing offline as a first-class state gives users a clear message and unblocks local diagnostics. How to apply: extend offlineState (cache TTL, retry heuristics) here rather than inside QueryEngine so that all entry points share one probe. Coverage in QueryEngine.offline.test.ts sets setOfflineMode(true) deterministically.
…in builtin status BuiltinStatusData grew three new fields: providerName (from getActiveProviderProfile, falls back to ''), offline (from isOfflineMode), and tokenCount (tokenCountWithEstimation of message history). buildBuiltinStatusSegments now: - prepends an [OFFLINE] error segment when offline - prefixes modelName with 'provider: ' when a profile is set - shows 'NN tokens ($X.XX)' in the cost segment so users see budget burn-in even when dollar total is low - shifts priorities +1 to keep the existing fitSegments precedence Why: provider-aware sessions and offline/online state were visible nowhere in the status bar, and the cost column was empty for users on free tiers where costUSD=0 but tokens add up. How to apply: when adding new BuiltinStatusData fields, default them in status-line test helpers and bump affected existing snapshots on purpose rather than letting them rot.
Brings the 5 new commits (changeDetector debounce/fsevents refactor, theme palettes, sub-argument suggestions, offline-state short-circuit, statusline enhancements) into main. Resolved conflict in src/utils/settings/changeDetector.ts getSourceForPath: main's HEAD version normalize()s both dropInDir and the candidate path against chokidar's forward-slashes on Windows — kept HEAD's wrap on top of upstream-main's dependencies.* indirection, since both sides already routed the source paths through . Auto-merged cleanly: theme.ts, ThemePicker.tsx, types.ts, BuiltinStatusLine, commandSuggestions.ts (and their tests), QueryEngine.ts, plus additions of offlineState.ts and QueryEngine.offline.test.ts, theme.test.ts
Resolves errors uncovered while running tsc --noEmit on the freshly merged main. They were not caused by my earlier commits — symptoms of fork drift from upstream-main — but they each blocked `bun run check` and one (DevBar) broke `bun run build` outright. Patches: - PromptInput.tsx: import toPersistableEffort from ../../utils/effort.js (function exists at src/utils/effort.ts:207 since 25b034b but the import was missing) and spread mainLoopModelForSession conditionally instead of assigning undefined (type forbids it) - REPL.tsx: drop the dead `import { DevBar } from '../components/DevBar.js'` whose component was removed in e6ce103 refactor(open-build) - ManagePlugins.tsx: gate the author .name render on typeof !== 'string' since the manifest schema allows author to be either a string or { name, email, url } - pluginLoader.ts: add strict: false to the test-only fakePluginMarketplaceEntry - openaiShim.test.ts: cast { reasoningEffort: 'max' } to any because the test documents the historical max→high mapping but the union is 'low'|'medium'|'high'|'xhigh' - observer.ts: type the for-loop messages as Array<{ type?: string; message?: any }> so the dead branch msg.type === 'tool_result' no longer complains. Runtime behaviour identical. Why: 6 distinct TS errors gating typecheck and one build breaker. All observed in main post-merge. How to apply: each patch is one-line-equivalent. Do not bundle unrelated cleanup into this commit.
…claude - Resolve conflicts in openaiShim.ts and config.ts - Retain local tool history compression and Ollama integration - Integrate upstream Gemini context caching configuration and TTL properties - Fix template literal type casting in cacheStats and cost loaders - Fix client cast to any in geminiCache.test.ts for tsc type safety
- Resolve conflicts in commands.ts, PromptInput.tsx, and ide.ts - Retain local advisor command and support for antigravity/agy IDE aliases - Clean up deprecated inline effort notification from PromptInput.tsx (now in Notifications.tsx) - Install and configure new upstream dependencies (graphology, web-tree-sitter, etc.)
- Merge latest features from Gitlawb/openclaude (v0.23.0) into main - Integrate Cloudflare Workers AI and modular message refactoring - Resolve conflicts in commands.ts, PromptInput.tsx, and providerProfiles.ts - Retain local terminal session isolation and project overrides for provider profiles
Integra as últimas novidades e correções do original Gitlawb/openclaude (v0.24.0), incluindo o suporte a customização de forms/set de companions, animações de tiro, novos modelos, e detecção de ultrathink, preservando totalmente os recursos de loja e pets customizados locais.
Mescla a branch upstream-main integrada para a branch de desenvolvimento local main, unificando todos os recursos de missões (quests) locais com as novidades de v0.24.0.
Adiciona rotação automática de anúncios a cada 15 segundos no Spinner quando a opção de ganhos do Ads (ads.enabled && ads.earnCode) está ativa. Isso otimiza o acúmulo de créditos durante turnos mais longos, tasks e execuções em segundo plano com múltiplos subagentes.
…longos" This reverts commit f1d2589.
Adiciona suporte ao Gemini 3.6 Flash e remove definicao duplicada de Gemini 3.5 Flash introduzida em merge anterior para corrigir testes.
Sobe limites hardcoded para variaveis de ambiente opt-in, mantendo defaults identicos aos atuais: - OPENCLAUDE_PERSISTENT_MAX_ATTEMPTS=0 desativa o teto de tentativas persistentes em withRetry. - OPENCLAUDE_PERSISTENT_MAX_BACKOFF_MS e OPENCLAUDE_PERSISTENT_RESET_CAP_MS ajustam os caps de backoff e reset sem rebuild. - OPENCLAUDE_MAX_RETRIES=999999 e OPENCLAUDE_MAX_529_RETRIES=0 dao controle total sobre retries da API. - OPENCLAUDE_GOAL_MAX_TURNS=0 remove o teto de 50 turns em /goal. - OPENCLAUDE_QUERY_HARD_MAX_MS=0 e OPENCLAUDE_QUERY_IDLE_TIMEOUT_MS=0 desativam o watchdog do query guard sem desligar leases. Testes existentes atualizados para 0/Infinity novo contrato. Fixtures/ ficaram untracked por serem artefatos de teste locais nao versionados.
Mescla a ramificação upstream/main, resolvendo conflitos em modelOptions.ts, providerProfiles.ts e bun.lock. Mantém as customizações locais do Crocbiçom, do editor Antigravity e lógicas estendidas de ads/segurança.
Remove os marcadores de conflito remanescentes em `src/commands/ads.tsx`, `src/commands/ads.test.ts` e `src/services/tips/gitlawbEarn.test.ts`, preservando o texto explicativo de contextualização de anúncios local.
…eiro - Corrige tipos e cache de getCompanion em companion.ts - Restaura deterministic.ts do companheiro pós-merge - Adiciona suporte e tipo para 'antigravity' IDE em ide.ts - Corrige importação de modelo Opus em modelCost.ts - Corrige invocação segura de cache em permissions.test.ts e sintaxe em ads.test.ts
…de skills Adiciona os documentos de arquitetura e o cronograma detalhado de passos para a migração nativa das 14 skills do stoneage.
- Adiciona tratamento defensivo para ausência de MACRO no CLI - Ignora validação do provider se o subcomando for 'skills' - Corrige flag '--add-dir' para aceitar múltiplos diretórios repetíveis - Evita quebra de importação dinâmica do Claude in Chrome MCP - Atualiza custos de tokens considerando o Opus 4.8 em modo rápido
There was a problem hiding this comment.
Sorry @mat-dgruber, your pull request is larger than the review limit of 150000 diff characters
Reviewer's GuideAdds a native Sequence diagram for new offline handling in QueryEngine submitMessagesequenceDiagram
participant User
participant QueryEngine
participant OfflineState as offlineState
User->>QueryEngine: submitMessage(prompt)
QueryEngine->>OfflineState: checkInternetConnection()
OfflineState-->>QueryEngine: boolean (online/offline)
alt offline
QueryEngine->>OfflineState: isOfflineMode()
OfflineState-->>QueryEngine: true
QueryEngine-->>User: assistant message (offline warning)
QueryEngine-->>User: result { stop_reason: offline }
else online
QueryEngine->>QueryEngine: isSessionPersistenceDisabled()
QueryEngine->>QueryEngine: wrappedCanUseTool(...)
QueryEngine-->>User: normal streamed results
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
- Adiciona ignore para a dependência @azure/identity e limpa ignore inativos em knip.json - Cria script typecheck no pacote web/package.json - Substitui configuração legada e quebrada do Astro por tsconfig para React+Vite - Restaura os arquivos web/src/content.ts e web/src/vite-env.d.ts ausentes - Corrige incompatibilidades estritas de tipos no Zustand e no react-markdown do web
…ongas Altera o cap padrão de `replMaxTurns` de 50 para 0 (sem limite) tanto no `createDefaultGlobalConfig` quanto na constante `DEFAULT_REPL_MAX_TURNS`, eliminando a interrupção "Reached the maximum number of turns (50)" em sessões interativas longas. O usuário pode configurar um valor positivo via `config.replMaxTurns` quando necessário.
… management, and landing page
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
Este Pull Request traz uma grande consolidação de evoluções, correções e novas funcionalidades desenvolvidas e testadas no fork
mat-dgruber/openclaude, sincronizando e aprimorando o estado mais recente do repositório base (Edwardmaster7/openclaude).🔑 Destaques das Mudanças Integradas
1. 🔒 Gerenciamento de Sessão e Recuperação Automática de Crash (
sessionLock&sessionRecoveryCheck)src/utils/sessionLock.tscom validação de PID e estado.src/utils/sessionRecoveryCheck.tspara identificar se a última sessão caiu inesperadamente.autoResumeOnCrashnas configurações globais e prompt interativo durante o startup da CLI para resumir sessões com zero perda de progresso.2. 🌐 Interface Web Completa (
web/)web/contendo:MessageBubble,MessageInput, e leitor de histórico.MarkdownRenderer) e visualizador de chamadas de ferramentas (ToolCallDisplay).3. 📢 Otimização do Sistema de Anúncios e Dwell-time (
/ads&gitlawbEarn)/adsAprimorado: Exibição de saldo formatado em USD, regras de contexto e histórico de impressões enviadas na payload.4. 🪨 Skills Stoneage e Token Economy Nativa (
src/skills/bundled/stoneage.ts)stoneageetoken-economy(answer-first,code-only,silent-tools,context-trim, etc.) direto no bundle estático.5. 🎨 Temas Expandidos, Statusline e Personalização Visual
dracula,nord,monokai,solarized,gruvbox,synthwave,cyberpunke suporte athemeOverrides.[OFFLINE], custo e tokens na statusline padrão.6. ⚡ Suporte ao Gemini 3.6-Flash e Ajustes CLI
oc: Binárioocregistrado empackage.jsonpara acionamento direto via terminal.🧪 Plano de Testes e Validação
bun test src/utils/sessionLock.test.ts(PASS)bun test src/utils/sessionRecoveryCheck.test.ts(PASS)bun test src/services/ads.test.ts(PASS)bun test src/skills/bundled/stoneage.test.ts(PASS)bun test src/utils/theme.test.ts(PASS)bun run buildexecutado com sucesso e verificação do frontend web concluída sem erros de tipagem.oc.