vtcode-commons
July 4, 2026 · View on GitHub
Root AGENTS.md | Shared traits and utilities. Zero business logic — pure infrastructure.
Module Groups
| Area | Modules |
|---|---|
| Traits | paths/ (WorkspacePaths, PathResolver), errors/ (ErrorFormatter, ErrorReporter), telemetry/ (TelemetrySink) |
| Display | ansi/, colors/, styling/, diff_preview/, color256_theme/, color_policy/ |
| LLM | llm/ (BackendKind, LLMError, Usage) |
| Filesystem | fs/, diff/, diff_paths/, vtcodegitignore/ |
| Text | tokens/, unicode/, sanitizer/, slug/, formatting/ |
| Async | async_utils/, thread_safety/ (RelaxedAtomic) |
| Other | editor/, http/, project/, validation/, serde_helpers/, env_lock/ |
Rules
- Re-export key types from
lib.rs:WorkspacePaths,TelemetrySink,ErrorFormatter,BackendKind, etc. reference.rsprovides in-memory test adapters:StaticWorkspacePaths,MemoryTelemetry,MemoryErrorReporter.ui_protocol/is a submodule, not a flat module.anstyle_utilsgated behindtuifeature.
Gotchas
pathshas two containment tiers: lexicalensure_path_within_workspaceand async symlink-resolvingensure_path_within_workspace_resolved. Downstream crates delegate here — do not fork the logic.retryowns the canonicalRetryPolicy(delay math, jitter,RetryDecision/RetryStep,simple()constructor). vtcode-core only layers domain adapters on top.error_category/classifies LLM errors for retry —is_retryable_llm_error_message()is the key function;classify_anyhow_error→ErrorCategoryis the single classifier for tool errors.env_lock/is macOS-specific env mutex — used byvtcodebinary, not by library crates.utils/containscalculate_sha256()used byvtcode-indexer.