Skip to content

Review and remaining issues #98

Closed
11 of 11 issues completed
Closed

Description

@xavier-arosemena

Hello,

Please analyze the current code.
Give me your analysis of the functionality, readiness, bugs, and possible improvements.

Activity

  1. xavier-arosemena commented on Jul 31, 2026

    @xavier-arosemena
    OwnerAuthor

    Architecture Review — Roo+ (v3.75.1)

    Scope reviewed: ~480K lines of TypeScript across 13 workspace packages (extension core src/, headless CLI apps/cli, React webview webview-ui, shared packages types/core/ipc/telemetry/vscode-shim). All checks executed live against a clean master.


    1. Functionality Overview

    Roo+ is a fork of Zoo Code / Roo Code / Cline — an AI coding assistant for VS Code. It ships a 90-mode pre-loaded agent library (233-agent catalog), MCP support, 25+ LLM providers, terminal integration, tree-sitter code indexing, atomic file writes, and 18+ locale localizations.

    Component Purpose Health
    src/core Extension host: tasks, delegation, webview protocol, config, tools Strong, mid-refactor
    src/services/ Extracted services (TaskOrchestrator, TaskHistory, ProviderProfile, Marketplace) Good (recent S3 work)
    apps/cli Headless agent via vscode-shim; TUI, --print, --stdin-prompt-stream modes Good
    webview-ui React UI with cachedState buffering pattern Good; components monolithic
    packages/types Zod schema registry + z.infer types (S1 protocol) In migration

    2. Readiness Assessment — GREEN

    Executed against the live tree:

    Gate Result
    Type check (pnpm check-types) ✅ 10/10 packages pass (6 cached)
    Lint (pnpm lint) ✅ 10/10 packages pass (full turbo cache)
    Extension tests (roo-plus) ✅ 7,148 passed / 38 skipped (431 files, 288s)
    CLI tests (@roo-code/cli) ✅ 534 passed / 1 skipped (39 files)
    Git state Clean working tree on master, active dev

    The suite is exceptionally healthy (~7,700 passing tests). Combined with the CI ratchet (scripts/verify-message-schemas.mjs), I consider this release-ready from a correctness standpoint, with the caveats below.


    3. Architecture Assessment

    Strengths (verified in code, not just docs):

    • Typed + validated message boundary — fail-closed zod validation at both ClineProvider.setWebviewMessageListener and CLI message-processor.ts. Malformed messages are logged and rejected, never dispatched.
    • Domain-split dispatcher — webviewMessageHandler.ts replaced the ~4,000-line switch with 15 per-domain handler modules behind a thin router.
    • DI with narrow ports — TaskOrchestrator injects getter ports for testability; fail-forward delegation serialization (runDelegationTransition) is a thoughtful race-safety design.
    • Security hardening — DOMPurify (sanitizeHtml), pinned escapeXML in TerminalOutput, nonce + strict-dynamic production CSP with explicit DEV-ONLY 'unsafe-eval' separation (ClineProvider.ts), path-traversal guards in read/write tools, 0o600 credential files.
    • cachedState settings pattern correctly buffers edits from live useExtensionState() (per AGENTS.md) with change-detection coverage (SettingsView.change-detection.spec.tsx).

    Debt signals: 82 TODO/FIXME markers; 12 production files in src/core with as any (73 test files); 351 files in eslint-suppressions.json; 13 open items in the team's own DEBT.md. ClineProvider is still 2,552 lines.


    4. Bugs & Findings (Forensic)

    F1 — [LOW] Event-listener leak (not in DEBT.md). setupQuietMode() registers process.on("warning", () => {}) at line 317 with an anonymous handler that is never removed by restoreConsole(). Because the PromptManager cycles quiet-mode per prompt in interactive/TUI mode, listeners accumulate over a long session. Fix: keep a named handler reference and process.removeListener it in restoreConsole().

    F2 — [LOW] Silent message drop at the router. webviewMessageHandler.ts silently no-ops on unregistered message types (the console.log is commented out). Unregistered types pass the boundary structurally (by design), then vanish here with zero observability — a misspelled or regressed type fails silently. Recommend a debug-level log in the fall-through branch.

    F3 — [INFO] Dead message type. setApiConfigPassword is registered in the zod registry (providerConfig.ts) but has no handler and no sender (documented no-op). Retains a security-sensitive message type with no effect. Remove or implement.

    F4 — [LOW] Plaintext CLI credential storage. credentials.ts persists the legacy auth token as plaintext JSON (0o600). Documented as deprecated cleanup-only, so low risk — but it is a plaintext secret on disk without OS keychain integration.

    F5 — [INFO] No-op shim logger. run.ts calls setLogger with all no-ops, collapsing vscode-shim diagnostics; combined with quiet-mode, CLI error observability is limited (only the extension output channel path survives).

    F6 — [LOW] Fragile closure ordering in waitForTaskCompletion. extension-host.ts references cleanup/messageHandler before their const/let declarations. Functionally correct due to temporal ordering, but a TDZ hazard for future edits.


    5. Recommendations (ICE-prioritized)

    1. Fix F1 (listener leak) — 1-day fix, removes a real resource leak in long-lived CLI processes.
    2. Add F2 debug logging — closes the observability gap for unregistered messages; pair with the S1-M4 broadening already underway.
    3. Complete protocol migration (DEBT Documentation #6/Proper loggin throughout #7) — the 149 transitional types and untyped outbound ExtensionMessage are the largest remaining security/correctness surface. The ratchet holds the line; accelerate per-domain.
    4. Resolve upstream drift (DEBT Implement improved modes #2, high) — conflict-heavy merges risk silently dropping upstream security fixes; adopt squash/automated conflict detection.
    5. Remove dead types (F3) and retire legacy CLI credential path (F4) during the next cleanup sprint.
    6. Decompose monolithic webview components (ChatView/ChatRow ~1.7–1.8k lines, DEBT Stabilized #11) — the extension-side slimming (S3) has no webview counterpart yet.
    7. Enforce a CI coverage threshold (DEBT Replace welcome banner #8) — test volume is excellent, but no floor is enforced.
    8. Fix apps/cli/README.md upstream install URL (DEBT Migration to Zoo-Code #1, high) — users following it may install upstream Zoo Code instead of Roo+.

    Bottom Line

    Functionality: Complete and broad — full agent platform in the extension plus a genuinely capable headless CLI (resume, session management, NDJSON streaming, cancellation recovery).
    Readiness: Ready for release — type-check, lint, and ~7,700 tests all green; security boundary and CSP posture are strong and actively hardening.
    Bugs: No critical or high-severity defects found. Five low/info findings (one real resource leak in the CLI), all with concrete fixes. The codebase is healthy, actively governed (ADR + DEBT.md + CI ratchets), and trending toward a well-factored architecture — the primary risks are upstream merge drift and the incomplete message-protocol migration, both already tracked by the team.

  2. xavier-arosemena commented on Jul 31, 2026

    @xavier-arosemena
    OwnerAuthor

    All requested work is complete. Debt signals are registered in DEBT.md and all six bug/finding fixes (F1–F6) plus the high-priority README debt (DEBT#1) were implemented via delegated specialized sub-tasks. Protocol migration (DEBT #6/#7) was left out of this sprint as requested.

    1. Debt Registration (DEBT.md)

    • New findings F1–F6 added to the register with locations, impact, and suggested fixes (High: F1; Medium: F2, F4; Low: F3, F5, F6). F3 was subsequently moved to the ✅ Recently Resolved table by the fixing task, with the list renumbered consistently.
    • New "📋 TODO/FIXME Inventory" section — 20 genuine production-code markers catalogued with exact file/line links (e.g., run.ts:187 provider/model validation, ProviderSettingsManager.ts:82 async-constructor, Task.ts:1165 message-save efficiency), flagged as open debt with no owner.

    2. Fixes Delivered (delegated sub-tasks)

    # Fix Result
    F1 CLI listener leak — process.on("warning") anonymous handler now stored and removed in restoreConsole() (extension-host.ts) +1 test asserting listener-count returns to baseline; 535 CLI tests, lint clean
    F2 Silent message drop — debug-gated provider.log() for unhandled webview types (webviewMessageHandler.ts) +2 tests (debug off/on); 64 spec tests, lint clean
    F3 Dead setApiConfigPassword — removed schema, registry, union member, tests; updated ratchet baseline + ADR counts (providerConfig.ts) Zero repo references; ratchet OK (16/165); 362 types tests, lint clean
    F4 Legacy credential write path retired — saveToken removed; module is now read/delete-only for auth status/auth logout (credentials.ts) 531 CLI tests, lint clean
    F5 No-op shim logger — vscode-shim logs now route through DebugLogger and enable on --debug (run.ts) +2 tests; 533 CLI tests, type-check + lint clean
    F6 TDZ hazard — waitForTaskCompletion declarations reordered to remove forward references (extension-host.ts) 533 CLI tests, lint clean
    DEBT#1 CLI README upstream install URL — added warning callout documenting the fork divergence; install commands preserved and explicitly flagged (apps/cli/README.md) Prettier-clean

    3. Final Verification (all green)

    • pnpm check-types — 10/10 packages pass
    • pnpm lint — 10/10 packages pass (no new suppressions; --max-warnings=0)
    • Message-schema ratchet — OK (16 registered baseline, 149 untyped ≤ 149)
    • Extension suite — 7,150 passed / 38 skipped (431 files; +2 from F2)
    • CLI suite — 531–535 passed / 1 skipped (verified per sub-task)

    4. Remaining (deliberately deferred / out of scope)

    • DEBT Documentation #6/Proper loggin throughout #7 — protocol migration of the 149 transitional types and untyped outbound ExtensionMessage (excluded from this sprint per your instruction).
    • DEBT Implement improved modes #2 — upstream merge-drift strategy (process item, not a code fix); still tracked in the register.
    • DEBT Stabilized #11 — decomposition of the ~1.7–1.9k-line webview components; large refactor, remains open in the register.

    Every change follows repo style (tabs, no semicolons), adds no .changeset, and introduces no new lint suppressions. The codebase remains release-green after all fixes.

  3. xavier-arosemena commented on Jul 31, 2026

    @xavier-arosemena
    OwnerAuthor

    The Semble EACCES bug is root-caused, reproduced, fixed, and verified end-to-end against the real release. Both installation paths are now resolved.

    Root Cause (proven, not guessed)

    spawn /root/.vscodium-server/.../semble/semble EACCES is not a permissions problem you can fix with chmod. The semble v0.5.2 release archives are PyInstaller one-dir builds wrapped in a top-level semble/ directory:

    semble/                  ← wrapper DIRECTORY
      semble                 ← the real executable (mode -rwxr-xr-x)
      _internal/…            ← bundled runtime (~130 MB)
    

    SEMBLE_ARCHIVES declared binary: "semble" (a flat filename), so the downloader computed stagedBinaryPath = <stagingDir>/semble → the wrapper directory. Directories pass chmod/fs.access, get swapped in, and are returned as binaryPath — then spawn(<dir>) yields EACCES. You cannot make a directory executable, which is why every prior chmod-based fix failed.

    I reproduced this exactly:

    • spawn("staging/semble") → spawn staging/semble EACCES (your error, verbatim)
    • staging/semble/semble --help → exit 0 (works)
    • Checksum of the downloaded archive matched the hardcoded SHA-256 exactly.

    Fix (delegated + verified)

    semble-downloader.ts now resolves the real executable after extraction via new resolveSembleBinary()/findFileNamed() helpers (flat <dir>/semble → one-dir <dir>/semble/semble → bounded recursive fallback):

    • Fresh download (attemptDownload): chmods and returns the correct post-swap path <storageDir>/semble/semble/semble.
    • Fast paths in downloadSemble now require a file, not a directory — this self-heals existing broken installs in place (no re-download).
    • getSembleBinaryPath is file-only.

    Real end-to-end verification: replicated the fixed resolution against the actual downloaded archive → resolved to …/semble/semble/semble (isFile: true) → spawned --help → exit 0.

    Your question: bundle-with-runtime vs download-only?

    Measured sizes:

    Option Size
    Lone launcher (current "bundle") 9.2 MB — cannot run (missing _internal/)
    Full one-dir runtime ~140 MB/platform (130 MB _internal)
    Compressed per-platform archive ~55 MB
    Universal VSIX × 4 platforms ~552 MB — impractical

    Assessment: bundling the runtime is not viable for a platform-universal VSIX, and the current launcher-only bundle is non-functional (verified: [PYI-795527:ERROR] Failed to load Python shared library …/_internal/…: No such file or directory). Decision: stick with the download version as the sole mechanism (already checksum-verified, multi-source fallback, retry, atomic swap, redirect-trust). Offline/air-gapped users use the existing codebaseIndexSembleBinaryPath setting to point at a manually-installed binary.

    So, to confirm both paths:

    1. Fallback (download) path — ✅ fixed and verified (real archive, real spawn, exit 0; self-heals broken installs).
    2. Bundled path — ✅ removed as a mechanism (it was shipping a non-functional 9.2 MB file). Deleted bin/semble + bin/, removed the .vscodeignore include, removed the extensionPath param + bundled-copy block from the downloader, deleted scripts/bundle-semble.sh + its vsix invocation, updated provider.ts, specs, ADR, and the DEBT.md resolved-debt table.

    Verification status

    • Semble specs: 119 tests pass (semble-downloader, semble-cli, provider), including new regression tests for one-dir/flat/self-heal/getBinaryPath.
    • Type-check (roo-plus): pass.
    • Lint: clean, no new suppressions.
    • No .changeset created; safeguards (checksum, redirect trust, retry, atomic swap) untouched.

    For the user's actual environment: the existing broken install at …/xavier-arosemena.roo-plus/semble/ will self-heal on next enable — the resolver finds semble/semble/semble, sets the exec bit on the real file, and spawn succeeds. If it still fails after this build, delete the …/semble folder once and re-enable indexing to force a clean download.

  4. xavier-arosemena commented on Jul 31, 2026

    @xavier-arosemena
    OwnerAuthor

    Mode descriptions are reviewed, root-caused, and fixed. Your suspicion was correct: the cleaning fixed the committed data, but a runtime re-seed bug (introduced in v3.75.1) still caused "not always present" for existing users — and it had a second, worse data-loss defect alongside it. Both are now fixed.

    Review findings

    All data sources are now clean (verified against the live tree):

    Source Modes Missing descriptions
    Built-in DEFAULT_MODES (mode.ts) 5 base 0
    .roomodes (preloaded) 90 0
    pre-installed-modes.yml (VSIX bundle) 90 0
    Marketplace modes.yml (incl. non-preloaded ~155) 245 0

    So the fix_descriptions/add_descriptions cleaning + the verify-roomodes-sync.mjs guard resolved the source of missing descriptions. The UI only shows a subtitle when description is truthy (ModeSelector.tsx:297), so any mode lacking one silently shows no subtitle — which is exactly what users saw.

    Root causes in the runtime re-seed (seedPreInstalledModes, added v3.75.1)

    • Bug A — .some() guard never repairs partial states ([old line 386]): existingModes.some(m => m.description…) returns true if at least one mode has a description, so the re-seed only fired when zero modes had descriptions. A partially-seeded install (some described, some not) was never repaired → "not always present."
    • Bug B — version-change re-seed OVERWRITES the user's whole modes file: on any extension upgrade the code replaced the entire customModes settings file with the bundled 90 modes, destroying user-added/edited modes.
    • Bug C (latent): sync-custom-modes.mjs:347 preserves existing .roomodes entries on slug conflict, so a stale file could reintroduce missing descriptions when the sync is re-run locally.

    Fix delivered (delegated + verified)

    Rewrote seedPreInstalledModes() to merge-fill:

    • Bug A fixed: triggers repair when any bundled mode in the settings file lacks a description (needsDescriptionFill).
    • Bug B fixed: never overwrites — preserves user modes and all user fields (name/roleDefinition/groups/customInstructions); only back-fills empty descriptions from the bundle; adds new bundled modes only on version change; write-only-on-change.
    • No-op fast path: same version + all described → no I/O.

    Tests: 4 new regression tests (partial-seed repair, upgrade preserves user modes, no-op, fresh install) — 52/52 pass (verified myself), sibling specs 72 pass, tsc --noEmit clean, lint clean (additionally pruned 12 no-explicit-any suppressions). No .changeset created.

    Registered in DEBT.md: resolved-debt row for the description bug, plus a new Low item #16 tracking the sync-custom-modes.mjs stale-merge trap (Bug C) with a suggested one-line fix for a future sprint.

    Effect for real users: on next activation/upgrade, existing installs with partial or missing descriptions get them back-filled in place — no reinstall, no mode loss, no manual reset needed.

  5. xavier-arosemena commented on Jul 31, 2026

    @xavier-arosemena
    OwnerAuthor

    All documentation is updated to reflect the 2026-07-31 sprint, via a delegated documentation sub-task, and I independently verified the result (sync + prettier + content spot-check).

    Files updated

    Changelogs

    • CHANGELOG.md — Added 10 items to the [Unreleased] section under the existing emoji subsection headers:
      • 🐛 Bug Fixes (+5): CLI event-listener leak, webview-router unhandled-message observability, legacy CLI credential write path retired, CLI vscode-shim logger → DebugLogger, waitForTaskCompletion TDZ hazard.
      • 🚀 Enhancements (+4): Semble EACCES one-dir-layout fix, bundled Semble binary removed (download-only), pre-installed mode descriptions always present (merge-fill), CLI README upstream-install warning.
      • 🔒 Security (+1): dead setApiConfigPassword message type removed.
      • Also corrected stale counts in pre-existing Unreleased items: "17 security-sensitive types" → 16, "17 baseline types" → 16, and dropped the dead "password" domain.
    • src/CHANGELOG.md — mirrored, verified SYNCED via cmp -s.

    READMEs

    • README.md — fixed the only stale count: "All 97 pre-loaded modes" → "All 90 pre-loaded modes" (grounded in .roomodes = 90; catalog = 90 ✅ + 143 ⬜ = 233 agents).
    • src/README.md — mirrored, verified SYNCED.

    DEBT.md

    • Added the missing resolved row Semble EACCES (one-dir archive layout) | resolveSembleBinary resolves the real executable; self-heals existing installs | Unreleased.
    • Verified F1–F6 findings, the TODO/FIXME inventory, the Semble bundled-launcher row, and the mode-description row are present and consistent; prettier-normalized the resolved table (formatting only).

    ADRs (src/docs/)

    • adr-semble-binary-download-only.md — NEW ADR (✅ ACCEPTED) documenting the download-only Semble decision: Context (non-functional launcher-only bundle, ~140 MB/platform runtime impractical for a universal VSIX, one-dir EACCES mis-resolution), Decision (remove bundle; resolveSembleBinary/findFileNamed handle flat + one-dir layouts; offline via codebaseIndexSembleBinaryPath), Consequences (small VSIX, first-use needs network, broken installs self-heal). Verified accurate against the code.
    • adr-typed-message-protocol.md — fixed the last stale "17 security-sensitive domains" → 16; 16/149/165 consistent throughout.
    • adr-bulk-install-modes.md — fixed stale "17 baseline types" → 16.
    • arch-review-semble-download-404.md — prettier-normalized (pre-existing non-compliant file); the "Superseded (2026-07-31)" note and Solution D rejection are intact.
    • adr-cloud-removal.md / adr-nodejs-v22.md — no false statements, left unchanged.

    Verification (all green)

    • cmp -s CHANGELOG.md src/CHANGELOG.md → SYNCED
    • cmp -s README.md src/README.md → SYNCED
    • npx prettier --check on all touched docs → All matched files use Prettier code style!
    • Grep sweep: no stale 17 security-sensitive/17 baseline, 97 pre-loaded/97 modes, bundle-semble.sh (except intentional historical/new entries), or setApiConfigPassword references remain outside intentional documentation.
    • Historical released changelog entries (v3.73.0 "97 pre-loaded", v3.72.1 bundle-semble.sh) intentionally preserved.
    • Documentation-only; no code/tests/scripts/YAML/JSON touched; no .changeset created.
  6. added a commit that references this issue on Aug 3, 2026
    07509d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions