Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Merge pull request #322 from mweinbach/codex/complexity-sweep

4 weeks ago

6564e4e
Authored
Max Weinbach8/28/2026, 10:35:20 PM
refactor: reduce complexity and harden lifecycle behavior

Parentse0e682e877a2fb

282 files changed
  • .github/workflows/ci.yml+49−0
  • AGENTS.md+2−1
  • CONTRIBUTING.md+3−0
  • apps/desktop/electron/ipc/workspace.ts+1−7
  • apps/desktop/electron/preload.ts+1−11
  • apps/desktop/electron/services/crashReporting.ts+3−3
  • apps/desktop/electron/services/diagnostics.ts+0−8
  • apps/desktop/electron/services/localLogs.ts+0
−2
  • apps/desktop/electron/services/productAnalytics.ts+1−28
  • apps/desktop/electron/services/windowChrome/index.ts+0−7
  • apps/desktop/electron/services/windowEnhancements.ts+0−1
  • apps/desktop/electron/services/windowsSandboxReadiness.ts+1−1
  • apps/desktop/quality-gates/README.md+22−10
  • apps/desktop/quality-gates/assertions.ts+29−10
  • apps/desktop/quality-gates/fixtures.ts+18−15
  • apps/desktop/quality-gates/mentionGeometry.ts+2−2
  • apps/desktop/quality-gates/snapshots/canvas-markdown-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-markdown-error-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-markdown-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-markdown-light-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-markdown-live-switch-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-markdown-loading-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-presentation-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-spreadsheet-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-spreadsheet-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-spreadsheet-light-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-text-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-text-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/canvas-text-light-linux.png——
  • apps/desktop/quality-gates/snapshots/first-launch-dark-1024-linux.png——
  • apps/desktop/quality-gates/snapshots/first-paint-dark-1024-linux.png——
  • apps/desktop/quality-gates/snapshots/first-paint-light-1024-linux.png——
  • apps/desktop/quality-gates/snapshots/first-paint-system-1024-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1024-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1024-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1024-light-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1024-reduced-motion-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1240-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1240-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1240-light-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-1240-reduced-motion-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-640-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-640-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-640-light-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-640-reduced-motion-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-800-dark-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-800-forced-colors-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-800-light-linux.png——
  • apps/desktop/quality-gates/snapshots/shipping-chat-800-reduced-motion-linux.png——
  • apps/desktop/quality-gates/specs/assertions.pw.ts+57−1
  • apps/desktop/quality-gates/specs/failure-proofs.pw.ts+1−1
  • apps/desktop/quality-gates/specs/journeys.pw.ts+23−17
  • apps/desktop/quality-gates/specs/media-modes.pw.ts+51−0
  • apps/desktop/quality-gates/specs/native-first-paint.pw.ts+3−1
  • apps/desktop/quality-gates/specs/performance.pw.ts+4−2
  • apps/desktop/src/app/attachmentInputs.ts+0−10
  • apps/desktop/src/app/composerDrafts.ts+1−1
  • apps/desktop/src/app/interactionQueue.ts+2−2
  • apps/desktop/src/app/store.actions/workspaceMemoryDefaults.ts+1−3
  • apps/desktop/src/app/store.helpers/controlSocket.ts+74−87
  • apps/desktop/src/app/store.helpers/jsonRpcSocket.ts+7−2
  • apps/desktop/src/app/store.helpers/paintScheduling.ts+1−1
  • apps/desktop/src/app/store.helpers/runtimeState.ts+1−1
  • apps/desktop/src/lib/adaptiveLayout.ts+2−2
  • apps/desktop/src/lib/analytics.ts+0−8
  • apps/desktop/src/lib/canvasMarkdown.ts+0−237
  • apps/desktop/src/lib/desktopPlatform.ts+0−15
  • apps/desktop/src/lib/indexedDbReliableBatchStore.ts+1−1
  • apps/desktop/src/lib/modelChoices.ts+2−13
  • apps/desktop/src/lib/spreadsheetSaveNotifications.ts+1−11
  • apps/desktop/src/lib/themeBootstrap.ts+1−1
  • apps/desktop/src/lib/time.ts+0−31
  • apps/desktop/src/lib/webTranscriptDelivery.ts+1−1
  • apps/desktop/src/lib/webWorkspaceState.ts+4−12
  • apps/desktop/src/ui/canvas/CanvasFilePreviewLayout.tsx+2−4
  • apps/desktop/src/ui/chat/ComposerReasoningToggle.tsx+0−19
  • apps/desktop/src/ui/chat/DraftThreadModelSelector.tsx+0−29
  • apps/desktop/src/ui/chat/InteractionCard.tsx+1−1
  • apps/desktop/src/ui/chat/ThreadModelIndicator.tsx+0−33
  • apps/desktop/src/ui/chat/activityGroups.ts+2−12
  • apps/desktop/src/ui/chat/feedMessageParsing.ts+1−1
  • apps/desktop/src/ui/chat/scrollOwnership.ts+1−1
  • apps/desktop/src/ui/chat/toolCards/toolCardFormatting.ts+1−1
  • apps/desktop/src/ui/layout/AppTopBar.tsx+102−152
  • apps/desktop/src/ui/layout/SidebarCollapseControl.tsx+1−0
  • apps/desktop/src/ui/settings/pages/AdvancedMemoryPanel.tsx+1−3
  • apps/desktop/src/ui/settings/pages/SubagentsPage.tsx+0−2
  • apps/desktop/src/ui/sidebar/SidebarWorkspaceItem.tsx+0−3
  • apps/desktop/test/advanced-memory-panel.test.ts+165−3
  • apps/desktop/test/app-topbar.test.tsx+278−2
  • apps/desktop/test/canvas-file-preview-layout.test.tsx+39−0
  • apps/desktop/test/canvasMarkdown.test.ts+0−126
  • apps/desktop/test/control-socket.ensure.test.ts+133−0
  • apps/desktop/test/control-socket.events.test.ts+63−0
  • apps/desktop/test/control-socket.lifecycle.test.ts+384−0
  • apps/desktop/test/control-socket.sessions.test.ts+85−0
  • apps/desktop/test/desktop-platform.test.ts+1−24
  • apps/desktop/test/ipc-workspace.test.ts+6−4
  • apps/desktop/test/jsonrpc-single-connection.test.ts+0−4
  • apps/desktop/test/modelChoices.test.ts+1−24
  • apps/desktop/test/platform-top-bar-chrome.test.tsx+34−19
  • apps/desktop/test/preload-boundary.test.ts+96−0
  • apps/desktop/test/spreadsheet-save-notifications.test.ts+33−0
  • apps/desktop/test/time-format.test.ts+0−34
  • apps/desktop/test/web-workspace-state.test.ts+11−0
  • apps/desktop/test/window-enhancements.test.ts+0−7
  • apps/desktop/tsconfig.json+1−1
  • apps/mobile/assets/toolbar/chat.xml+6−0
  • apps/mobile/assets/toolbar/compose.xml+6−0
  • apps/mobile/assets/toolbar/folder.xml+6−0
  • apps/mobile/assets/toolbar/more.xml+6−0
  • apps/mobile/assets/toolbar/remote-access.xml+6−0
  • apps/mobile/assets/toolbar/stop.xml+6−0
  • apps/mobile/bun.lock+0−5
  • apps/mobile/ios/CoworkMobile.xcodeproj/project.pbxproj+4−0
  • apps/mobile/ios/Podfile.lock+470−405
  • apps/mobile/package.json+0−1
  • apps/mobile/src/app/(app)/(tabs)/(chats)/_layout.tsx+4−1
  • apps/mobile/src/app/(app)/(tabs)/(chats)/thread/[id].tsx+2−1
  • apps/mobile/src/app/(app)/(tabs)/(settings)/_layout.tsx+4−1
  • apps/mobile/src/app/(app)/(tabs)/(skills)/_layout.tsx+4−1
  • apps/mobile/src/app/(app)/(tabs)/(workspace)/_layout.tsx+4−1
  • apps/mobile/src/app/_layout.tsx+33−25
  • apps/mobile/src/components/composerShared.tsx+2−2
  • apps/mobile/src/components/pairing/grouped-list.tsx+1−1
  • apps/mobile/src/components/pairing/pairing-home.fallback.tsx+2−2
  • apps/mobile/src/components/pairing/pairing-ios-ui.tsx+1−1
  • apps/mobile/src/components/thread-home/thread-home-screen.shared.tsx+5−4
  • apps/mobile/src/components/ui/app-button.tsx+1−1
  • apps/mobile/src/components/ui/hub-link-row.tsx+60−55
  • apps/mobile/src/components/ui/toolbar-icon.ts+16−0
  • apps/mobile/src/features/cowork/activityGroups.ts+1−1
  • apps/mobile/src/features/cowork/mcpStore.ts+0−5
  • apps/mobile/src/features/cowork/mobilePerformanceContracts.ts+1−1
  • apps/mobile/src/features/cowork/protocolTypes.ts+2−127
  • apps/mobile/src/features/cowork/remoteThreadBootstrap.ts+0−1
  • apps/mobile/src/features/cowork/sessionBootstrap.ts+1−1
  • apps/mobile/src/features/cowork/threadHomeModel.ts+3−3
  • apps/mobile/src/features/cowork/threadListModel.ts+1−1
  • apps/mobile/src/features/cowork/threadOfflineCache.ts+1−1
  • apps/mobile/src/features/cowork/threadStore.ts+0−2
  • apps/mobile/src/features/cowork/useWorkspaceConfigQuery.ts+0−236
  • apps/mobile/src/features/pairing/pairingTypes.ts+0−9
  • apps/mobile/src/features/relay/connectionState.ts+1−12
  • apps/mobile/src/features/relay/secureTransportClient.ts+3−17
  • apps/mobile/src/providers/MobileAppProvider.tsx+1−10
  • biome.json+1−1
  • crates/cowork-win-sandbox/README.md+25−21
  • docs/assets/desktop-product.png——
  • docs/audit-code-bloat.md+12−374
  • docs/complexity-tracker.md+472−0
  • docs/unused-code-audit.md+240−0
  • knip.json+8−3
  • package.json+3−1
  • scripts/complexity.ts+163−0
  • scripts/complexityCompare.ts+257−0
  • src/agent.ts+46−264
  • src/cli/repl/commandRouter.ts+33−95
  • src/cli/streamState.ts+0−25
  • src/coworkRuntime/download.ts+1−1
  • src/coworkRuntime/ensureReady.ts+2−2
  • src/coworkRuntime/install.ts+1−1
  • src/coworkRuntime/integrity.ts+1−1
  • src/coworkRuntime/manifest.ts+1−1
  • src/coworkRuntime/platform.ts+1−1
  • src/coworkRuntime/runtime.ts+1−1
  • src/import/conversations/normalize.ts+3−3
  • src/import/conversations/service.ts+2−11
  • src/import/conversations/snapshot.ts+1−1
  • src/import/externalHomes.ts+0−12
  • src/import/index.ts+0−2
  • src/models/childModelRouting.ts+1−1
  • src/platform/sandbox/bwrap.ts+1−1
  • src/plugins/catalog.ts+1−22
  • src/plugins/overrides.ts+1−1
  • src/providers/customModels.ts+1−1
  • src/providers/minimaxShared.ts+1−3
  • src/providers/modelDiscoveryAdapters.ts+6−44
  • src/providers/modelDiscoveryCache.ts+5−7
  • src/runtime/codexAppServer/config.ts+1−1
  • src/runtime/codexAppServer/notifications.ts+68−51
  • src/runtime/googleInteractionsModel.ts+0−4
  • src/runtime/googleNative/nativeTools.ts+1−11
  • src/runtime/googleNative/stream/mapToStreamParts.ts+13−28
  • src/runtime/googleNative/stream/processEvent.ts+175−251
  • src/runtime/pi/internal.ts+0−26
  • src/runtime/pi/rateLimitRetry.ts+1−1
  • src/server/agents/AgentControl.ts+7−24
  • src/server/artifacts/diffUtils.ts+4−4
  • src/server/artifacts/ooxml.ts+9−9
  • src/server/artifacts/types.ts+30−321
  • src/server/git/WorktreeService.ts+3−12
  • src/server/jsonrpc/routes/outcomes.ts+0−9
  • src/server/jsonrpc/routes/tasks.ts+1−1
  • src/server/jsonrpc/schema.tasks.ts+0−5
  • src/server/jsonrpc/serverRequestReceipts.ts+2−2
  • src/server/jsonrpc/sessionEventCapture.ts+20−15
  • src/server/jsonrpc/workspaceCatalog.ts+2−10
  • src/server/projection/conversationProjectionReasoning.ts+1−1
  • src/server/projection/conversationProjectionSessionEvents.ts+6−6
  • src/server/projection/conversationProjectionStreamUpdates.ts+2−0
  • src/server/runtime/SkillMutationBus.ts+7−2
  • src/server/session/SessionAdminManager.ts+4−14
  • src/server/session/SessionMetadataManager.ts+2−0
  • src/server/session/taskLocks.ts+4−6
  • src/server/session/turnExecution/referenceInjection.ts+4−13
  • src/server/session/turnExecution/steerCoordinator.ts+1−14
  • src/server/sessionBackup.ts+2−1
  • src/server/sessionDb/repository.ts+8−1
  • src/server/spreadsheetOoxml.ts+7−7
  • src/server/tasks/TaskCoordinator.ts+2−2
  • src/server/tasks/taskReviewPolicy.ts+1−9
  • src/server/threads/localThreadHost.ts+2−10
  • src/server/transport/httpJsonRpcConnection.ts+1−1
  • src/server/webDesktopService.ts+2−11
  • src/shared/agentProfiles.ts+1−1
  • src/shared/attachments.ts+1−1
  • src/shared/fnv1a.ts+9−0
  • src/shared/googleInteractionsStreamParts.ts+2−1
  • src/shared/reliableBatchQueue.ts+1−1
  • src/shared/toolRetry.ts+2−2
  • src/shared/transcriptBatchProtocol.ts+2−2
  • src/skills/defaultGlobalSkills.ts+2−2
  • src/skills/loadSkillBody.ts+1−7
  • src/sync/types.ts+0−8
  • src/telemetry/config.ts+1−1
  • src/telemetry/crashReporting.ts+3−3
  • src/telemetry/productAnalytics.ts+0−8
  • src/tools/taskReview.ts+0−2
  • src/tools/webSearch.ts+2−61
  • src/utils/atomicFile.ts+7−20
  • src/utils/fileLock.ts+0−3
  • src/utils/permissions.ts+1−1
  • src/utils/ripgrep.ts+7−14
  • src/workflows/inputSpill.ts+1−1
  • src/workflows/registry.ts+2−2
  • test/advancedMemory.store.test.ts+29−21
  • test/agent.remote-mcp.grep.test.ts+20−19
  • test/agent.test.ts+157−174
  • test/agent.toolloop.test.ts+288−428
  • test/atomicFile.test.ts+45−0
  • test/ci.workflow.test.ts+44−0
  • test/complexity-comparison.integration.test.ts+161−0
  • test/complexity-comparison.test.ts+156−0
  • test/complexity-report.test.ts+120−0
  • test/fixtures/mcp-local-integration-runner.ts+18−21
  • test/fixtures/mobile-platform-contract.tsx+64−4
  • test/fnv1a.test.ts+17−0
  • test/helpers/mock-react-native.ts+7−0
  • test/jsonrpc/projectors/assistant-segments.test.ts+82−0
  • test/mcp.local.integration.test.ts+3−3
  • test/mobile.app-button.test.tsx+116−0
  • test/mobile.app-provider.test.tsx+159−0
  • test/mobile.control-store.test.ts+19−0
  • test/mobile.grouped-switch-row.test.tsx+117−0
  • test/mobile.hub-link-row.test.tsx+159−0
  • test/mobile.remote-thread-bootstrap.test.ts+36−0
  • test/mobile.root-layout.test.tsx+112−0
  • test/mobile.secure-transport-client.test.ts+128−4
  • test/mobile.toolbar-native.test.tsx+477−0
  • test/permissions.test.ts+54−36
  • test/platform-boundary.baseline.json+11−25
  • test/platform-boundary.test.ts+2−2
  • test/platform/sandbox.test.ts+17−12
  • test/providers/model-discovery-cache.test.ts+0−8
  • test/providers/provider-options.test.ts+21−25
  • test/repl.command-router.test.ts+173−0
  • test/ripgrep.install.test.ts+134−0
  • test/runtime.pi-runtime.test.ts+58−16
  • test/runtime/codex-app-server/notifications.test.ts+427−0
  • test/runtime/codex-app-server/turn.test.ts+275−6
  • test/runtime/google-native/unit.stream-state.test.ts+385−0
  • test/runtime/google-native/unit.streamToolArguments.test.ts+92−0
  • test/runtime/google-native/unit.tool-projection.test.ts+172−0
  • test/server/sessionEventCapture.test.ts+194−0
  • test/session-backup.test.ts+58−0
  • test/session-db.test.ts+29−1
  • test/session/agentSession.settings.test.ts+28−0
  • test/skill-mutation-bus.test.ts+97−1
  • test/snapshots/mobile-accessibility.android.json+1−1
  • test/snapshots/mobile-accessibility.ios.json+1−1
  • test/tools/tools.webSearch.test.ts+105−0