Skip to content

Commit 9d3155e

Browse files
mini2sgithub-actions[bot]mrubensroomote[bot]daniel-lxs
authored andcommitted
Roo to main (zgsm-ai#532)
* Changeset version bump (RooCodeInc#7859) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat(chat): add chat search functionality with highlighting * feat: show notification when the checkpoint initialization fails (RooCodeInc#7766) Co-authored-by: daniel-lxs <[email protected]> * Bust cache in generated image preview (RooCodeInc#7860) Co-authored-by: Roo Code <[email protected]> * test: disable TaskHeader upsell tests * test: refactor TaskHeader test file * feat: Add cloud task button for opening tasks in Roo Code Cloud (RooCodeInc#7572) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> * fix: center active mode in selector dropdown on open (RooCodeInc#7883) Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * Make Posthog telemetry the default (RooCodeInc#7909) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Fix: Preserve first message during conversation condensing (RooCodeInc#7910) * In-app announcement for Roo Code Cloud (RooCodeInc#7914) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * chore: add changeset for v3.28.1 (RooCodeInc#7916) * Changeset version bump (RooCodeInc#7917) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Remove Roo Code 3.25 release announcement Removed the section about Roo Code 3.25 release notes. * fix: restrict @-mention parsing to line-start or whitespace boundaries (RooCodeInc#7876) Co-authored-by: Roo Code <[email protected]> * Fix message queue re-queue loop in Task.ask() (RooCodeInc#7823) * fix: preserve original first message context during conversation condensing (RooCodeInc#7939) * Add a little padding to the cloudview (RooCodeInc#7954) * test: increase test timeout configuration * test(ci): enable translation check and optimize test workflow * fix: make nested git repository warning persistent with path info (RooCodeInc#7885) Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * fix: include API key in Ollama /api/tags requests (RooCodeInc#7903) Co-authored-by: Roo Code <[email protected]> * feat: add Qwen3 Next 80B A3B models to chutes provider (RooCodeInc#7948) * ux: Smaller and more subtle auto-approve UI (RooCodeInc#7894) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Hannes Rudolph <[email protected]> Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Daniel <[email protected]> Co-authored-by: ItsOnlyBinary <[email protected]> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: John Richmond <[email protected]> * Disable Roomote Control on logout (RooCodeInc#7976) * Remove chevrons from chat buttons (RooCodeInc#7970) * chore: add changeset for v3.28.2 (RooCodeInc#7979) * Changeset version bump (RooCodeInc#7980) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * ux: Makes text area buttons appear only when there's text (RooCodeInc#7987) * fix: corrected C# tree-sitter query (RooCodeInc#7813) * feat: Move slash commands to Settings tab with gear icon for discoverability (RooCodeInc#7988) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Mubeen Zulfiqar <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Add Z.ai coding plan support (RooCodeInc#8003) * chore(deps): bump axios from 1.9.0 to 1.12.0 (RooCodeInc#7963) Bumps [axios](https://github.com/axios/axios) from 1.9.0 to 1.12.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.9.0...v1.12.0) --- updated-dependencies: - dependency-name: axios dependency-version: 1.12.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix context menu is obscured when edit message. (RooCodeInc#7951) * feat: add keyboard shortcut for "Add to Context" action (RooCodeInc#7908) Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * fix: handle ByteString conversion errors in OpenAI embedders (RooCodeInc#8008) * CONTRIBUTING.md tweaks and issue template rewrite (RooCodeInc#8014) * feat: Reposition Add Image button inside ChatTextArea (RooCodeInc#7989) * feat: move Add Image button inside ChatTextArea - Moved Add Image button from bottom toolbar to top-right inside text area - Repositioned Enhance Prompt button to be above Send button (bottom-right) - Both buttons now follow similar positioning pattern as Send button - Maintains consistent button styling and transitions * fix: corrected C# tree-sitter query (RooCodeInc#7813) * feat: Move slash commands to Settings tab with gear icon for discoverability (RooCodeInc#7988) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Mubeen Zulfiqar <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Add Z.ai coding plan support (RooCodeInc#8003) * chore(deps): bump axios from 1.9.0 to 1.12.0 (RooCodeInc#7963) Bumps [axios](https://github.com/axios/axios) from 1.9.0 to 1.12.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.9.0...v1.12.0) --- updated-dependencies: - dependency-name: axios dependency-version: 1.12.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix context menu is obscured when edit message. (RooCodeInc#7951) * feat: add keyboard shortcut for "Add to Context" action (RooCodeInc#7908) Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * fix: handle ByteString conversion errors in OpenAI embedders (RooCodeInc#8008) * CONTRIBUTING.md tweaks and issue template rewrite (RooCodeInc#8014) * Visual tweaks --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Mubeen Zulfiqar <[email protected]> Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: Daniel <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: NaccOll <[email protected]> Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: Hannes Rudolph <[email protected]> * feat: add i18n support for git commits and file operations * feat(i18n): update context menu translations in zh-CN and zh-TW locales * feat: Bring back a way to temporarily and globally pause auto-approve without losing your toggle state (RooCodeInc#8024) * Visual improvements and code cleanup (removes duplication) * Brings back an 'enabled' toggle for auto-approve * fix: filter out Claude Code built-in tools (ExitPlanMode, BashOutput, KillBash) (RooCodeInc#7818) Co-authored-by: Roo Code <[email protected]> * fix: handle square bracket HTML entities in Gemini responses (RooCodeInc#7577) Co-authored-by: Roo Code <[email protected]> * feat: Replace + icon with edit icon for New Task button (RooCodeInc#7942) Co-authored-by: Roo Code <[email protected]> * Release v3.28.3 (RooCodeInc#8025) * Changeset version bump (RooCodeInc#8026) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat: remove web-docs app (RooCodeInc#8027) Co-authored-by: Roo Code <[email protected]> * fix: skip flaky Windows test in custom-system-prompt.spec.ts (RooCodeInc#8023) Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * feat: add GDPR-compliant cookie consent banner (RooCodeInc#8022) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Release: v1.76.0 (RooCodeInc#8030) * Types 1.77.0 (RooCodeInc#8031) * feat(web): update homepage headline and tagline for remote control capabilities (RooCodeInc#7911) * Merge remote-tracking branch 'upstream/main' into roo-to-main * ux: Responsive Auto-Approve (RooCodeInc#8032) Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * feat(cloud): Add telemetry retry queue for network resilience (RooCodeInc#7597) * feat(cloud): Add telemetry retry queue for network resilience - Implement RetryQueue class with workspace-scoped persistence - Queue failed telemetry events for automatic retry - Retry events every 60 seconds with fresh auth tokens - FIFO eviction when queue reaches 100 events - Persist queue across VS Code restarts This ensures telemetry data isn't lost during network failures or temporary server issues. Migrated from RooCodeInc/Roo-Code-Cloud#744 * fix: address PR review feedback for retry queue - Fix retry order to use consistent FIFO processing - Add retry limit enforcement with max retries check - Add configurable request timeout (default 30s) - Add comprehensive tests for retryAll() method - Add request-max-retries-exceeded event - Fix timeout test to avoid timing issues * fix: resolve TypeScript errors in RetryQueue tests * fix(cloud): Address PR feedback for telemetry retry queue - Handle HTTP error status codes (500s, 401/403, 429) as failures that trigger retry - Remove queuing of backfill operations since they're user-initiated - Fix race condition in concurrent retry processing with isProcessing flag - Add specialized retry logic for 429 with Retry-After header support - Clean up unnecessary comments - Add comprehensive tests for new status code handling - Add temporary debug logs with emojis for testing * refactor: address PR feedback for telemetry retry queue - Remove unused X-Organization-Id header from auth header provider - Simplify enqueue() API by removing operation parameter - Fix error retry logic: only retry 5xx, 429, and network failures - Stop retrying 4xx client errors (400, 401, 403, 404, 422) - Implement queue-wide pause for 429 rate limiting - Add auth state management integration: - Pause queue when not in active-session - Clear queue on logout or user change - Preserve queue when same user logs back in - Remove debug comments - Fix ESLint no-case-declarations error with proper block scope - Update tests for all new behaviors * Docs: Overhaul README (RooCodeInc#8005) * docs: overhaul README for clarity and impact * fix: update badge links and styles in README for improved visibility * docs(README): stronger CTAs for Discord/Reddit; restore Modes/Roles incl. cloud agents * docs(readme): add support CTA; refine modes section; clarify custom modes wording - add centered help/links CTA under badges: [README.md](README.md:8-10) - expand feature list to explicitly include modes: [README.md](README.md:45) - rename section header “Modes and Roles” → “Modes”: [README.md](README.md:52) - update wording to “Custom Modes: build specialized modes for your team or workflow”: [README.md](README.md:60) * docs: implement @jdilla1277 suggestions for English README - Updated header to "Your AI-Powered Dev Team, Right in Your Editor" (removed Cline reference) - Changed line 44 to "Generate Code from natural language descriptions and specs" for better SEO - Removed "not the other way around" phrase from line 54 - Replaced "Cloud Agents" with "Roomote Control" on line 61 As requested by @hannesrudolph, these changes are only applied to the English README. * docs: clarify Roomote Control description and update related links in README * Reworked the contributor list. Made translastion corrections. --------- Co-authored-by: Roo Code <[email protected]> * Add organizationFeaturesSchema with roomoteControlEnabled (RooCodeInc#8085) feat: add organizationFeaturesSchema with roomoteControlEnabled - Add organizationFeaturesSchema with optional roomoteControlEnabled boolean - Integrate features property into organizationSettingsSchema as optional - Add comprehensive tests for new schema validation - Maintain backward compatibility with existing organization settings Co-authored-by: Roo Code <[email protected]> * Release: v1.78.0 (RooCodeInc#8089) chore: bump version to v1.78.0 * Get the model id property for a given provider (RooCodeInc#8009) * Fix: Transform keybindings in nightly build to fix command+y shortcut (RooCodeInc#8070) * fix: transform keybindings command references in nightly build The keybindings section was not being transformed during the nightly build process, causing command+y keybinding to reference the wrong command name (roo-cline.addToContext instead of roo-code-nightly.addToContext). - Added keybindings schema to types.ts - Updated generatePackageJson to transform keybindings command references - This ensures keybindings work correctly in the nightly build * fix: only include keybindings in output when they exist Updated generatePackageJson to conditionally add keybindings to avoid including undefined values in the generated package.json. Fixed eslint-disable comment placement. --------- Co-authored-by: Roo Code <[email protected]> * Add a list of sub-processors (RooCodeInc#8163) * Add cookie policy (RooCodeInc#8165) * ux: Redesigned Message Feed (RooCodeInc#7985) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Merge branch 'main' of github.com:zgsm-ai/costrict into roo-to-main * bug: Incorrect copy for "Run" command when approving execution (RooCodeInc#8179) * test: set default language to English in prompt tests * Supernova (RooCodeInc#8175) Co-authored-by: Chris Estreich <[email protected]> * chore: add changeset for v3.28.4 (RooCodeInc#8182) * Changeset version bump (RooCodeInc#8183) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat(chat): enhance user info display and file path highlighting * fix: support dash prefix in parseMarkdownChecklist for todo lists (RooCodeInc#8055) - Updated regex pattern to support optional dash prefix (e.g., "- [ ] Task") - Added comprehensive test coverage for both formats - Fixes issue where todo lists with dash prefixes were not being parsed correctly Fixes RooCodeInc#8054 Co-authored-by: Roo Code <[email protected]> * Updating the privacy policy to allow us to send occasional emails (RooCodeInc#8180) * Updating the privacy policy to allow us to send onboarding and occasional marketing emails. * docs: Clarified unsubscribe behavior and updated the Last Updated date * docs: update Last Updated date in Privacy Policy page * fix: apply tiered pricing for Gemini models via Vertex AI (RooCodeInc#8018) * fix: apply tiered pricing for Gemini models via Vertex AI - Modified calculateCost method to handle models where cacheReadsPrice is only defined in tiers - Added comprehensive tests for Vertex AI tiered pricing calculation - Fixes issue where local cost calculation always showed highest tier rates Fixes RooCodeInc#8017 * Delete src/api/providers/__tests__/vertex-tiered-pricing.spec.ts --------- Co-authored-by: Roo Code <[email protected]> Co-authored-by: Daniel <[email protected]> * update sambanova models (RooCodeInc#8186) * update sambanova models * fix typo * Fix duplicate rehydrate during reasoning; centralize rehydrate and preserve cancel metadata (RooCodeInc#8171) Co-authored-by: daniel-lxs <[email protected]> * Wrap code blocks by default (RooCodeInc#8194) * Merge remote-tracking branch 'upstream/main' into roo-to-main * Add an announcement for Supernova (RooCodeInc#8197) * Add an announcement for Supernova * Remove duplicate keys * refactor(chat): optimize ChatRow rendering and user info handling * Release v3.28.5 (RooCodeInc#8198) chore: add changeset for v3.28.5 * Changeset version bump (RooCodeInc#8199) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Remove language selection and word wrap toggle from CodeBlock (RooCodeInc#8208) * feat: Add keyboard shortcut for toggling auto-approve (Cmd/Ctrl+Alt+A) (RooCodeInc#8214) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Bare metal evals fixes (RooCodeInc#8224) Co-authored-by: Roo Code <[email protected]> * Fix: Improve reasoning block formatting for better readability (RooCodeInc#7868) * fix: prevent checkpoint text from wrapping in non-English languages (RooCodeInc#8207) Co-authored-by: Roo Code <[email protected]> * fix: respect Ollama Modelfile num_ctx configuration (RooCodeInc#7798) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Hannes Rudolph <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * feat: add package.nls.json checking to find-missing-translations script (RooCodeInc#8255) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * feat(types): add GPT-5-Codex model (RooCodeInc#8260) * chore: add changeset for v3.28.6 (RooCodeInc#8261) * Follow-up questions should trigger the "interactive" state (RooCodeInc#8259) * chore: add changeset for v3.28.6 (RooCodeInc#8263) * Changeset version bump (RooCodeInc#8262) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Add image for 3.28.5 (RooCodeInc#8266) * feat: add zai-org/GLM-4.5-turbo model to Chutes provider (RooCodeInc#8157) Co-authored-by: Roo Code <[email protected]> * Cloud account switcher (RooCodeInc#8223) * Cloud account switcher * Bare metal evals fixes (RooCodeInc#8224) Co-authored-by: Roo Code <[email protected]> * Rounded icons in chat account switcher * Visual tweaks to CloudView * Remove hardcoded timeout * Safer check * PR feedback * Fix test * Check for org mismatches in handleCredentialsChange * Cloud: use the existing auth event flow to handle org switching * Cleanup: broadcast() might be confusingly named. --------- Co-authored-by: Chris Estreich <[email protected]> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: John Richmond <[email protected]> * fix: checkpoint restore popover positioning issue (RooCodeInc#8219) (RooCodeInc#8220) Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * ux: Collapse thinking blocks by default (but control all of them with a keyboard shortcut) (RooCodeInc#8254) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Remove org switcher tooltip (RooCodeInc#8269) * chore: add changeset for v3.28.7 (RooCodeInc#8268) * Changeset version bump (RooCodeInc#8271) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Merge remote-tracking branch 'upstream/main' into roo-to-main * fix(i18n): spelling mistake in zh-CN chat.json * web: Opengraph image (RooCodeInc#8285) Co-authored-by: Matt Rubens <[email protected]> * Set port 3446 for web-evals in production mode (RooCodeInc#8288) * Show cloud switcher and option to add a team when logged in (RooCodeInc#8291) * fix: include initial ask in condense summarization (RooCodeInc#8293) (RooCodeInc#8298) * fix: include initial ask in condense summarization (RooCodeInc#8293) --------- Co-authored-by: Matt Rubens <[email protected]> * Fix frequent "No tool used" errors by clarifying tool-use rules (RooCodeInc#8292) * Add a couple more free models to the Roo provider (RooCodeInc#8304) * Release v3.28.8 (RooCodeInc#8305) * Changeset version bump (RooCodeInc#8306) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat: log out from cloud when resetting extension state (RooCodeInc#8312) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Merge remote-tracking branch 'upstream/main' into roo-to-main * feat: Add telemetry tracking to DismissibleUpsell component (RooCodeInc#8309) * feat: add telemetry tracking to DismissibleUpsell component - Added UPSELL_DISMISSED and UPSELL_CLICKED events to TelemetryEventName enum - Updated DismissibleUpsell component to track clicks and dismissals with telemetry - Added telemetry tests to DismissibleUpsell test suite - Events include upsellId in the payload for tracking specific upsells * refactor(webview): make handleDismiss synchronous in DismissibleUpsell test(webview): add scenario where dismissOnClick=true without onClick tracks only UPSELL_DISMISSED; update tests; all tests passing locally --------- Co-authored-by: Roo Code <[email protected]> * Correct tool use suggestion to improve model adherence to suggestion (RooCodeInc#8315) * Correct tool use suggestion to improve model adherence to suggestion * tweak * removing user hint when refreshing models (RooCodeInc#7710) * feat(zgsm): add quota info display and periodic updates * Show the Roo provider on the welcome screen (RooCodeInc#8317) * wip: Website Improvements (RooCodeInc#8303) Co-authored-by: Matt Rubens <[email protected]> * refactor: remove pr-reviewer mode (RooCodeInc#8222) * feat: add animated quota display with staggered transitions * Merge remote-tracking branch 'upstream/main' into roo-to-main * web: More website copy tweaks (RooCodeInc#8326) Co-authored-by: Matt Rubens <[email protected]> * fix: remove <thinking> tags from prompts for cleaner output and fewer tokens (RooCodeInc#8319) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Hannes Rudolph <[email protected]> * Upgrade Supernova (RooCodeInc#8330) * chore: add changeset for v3.28.9 (RooCodeInc#8336) * Changeset version bump (RooCodeInc#8337) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Track when telemetry settings change (RooCodeInc#8339) * fix: use max_completion_tokens for GPT-5 models in LiteLLM provider (RooCodeInc#6980) Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * Make chat icons shrink-0 (RooCodeInc#8343) * web: Testimonials (RooCodeInc#8360) * Adds lots of testimonials, 5-stars from marketplace * Fits more testimonials in one page * Testimonial heading tweak * ci: refresh contrib.rocks cache workflow (RooCodeInc#8083) * feat: add Claude 4.5 Sonnet model across all providers (RooCodeInc#8368) * chore: add changeset for v3.28.10 (RooCodeInc#8369) * Changeset version bump (RooCodeInc#8370) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * fix: correct AWS Bedrock Claude Sonnet 4.5 model identifier (RooCodeInc#8372) Fixes RooCodeInc#8371 - Updates the model ID from anthropic.claude-4.5-sonnet-v1:0 to anthropic.claude-sonnet-4-5-20250929-v1:0 to match AWS Bedrock naming convention Co-authored-by: Roo Code <[email protected]> * fix: correct Claude Sonnet 4.5 model ID format (RooCodeInc#8373) * chore: add changeset for v3.28.11 (RooCodeInc#8374) * Changeset version bump (RooCodeInc#8375) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * fix: Anthropic Sonnet 4.5 model id + Bedrock 1M context checkbox (RooCodeInc#8384) fix(anthropic): use claude-sonnet-4-5 id fix(bedrock): enable 1M context checkbox for Sonnet 4.5 via shared list closes RooCodeInc#8379 closes RooCodeInc#8381 * chore: add changeset for v3.28.12 (RooCodeInc#8385) * Changeset version bump (RooCodeInc#8376) * changeset version bump * Revise changelog for version 3.28.12 Updated version number and consolidated patch notes. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Fix Vertex Sonnet 4.5 (RooCodeInc#8391) * fix: remove topP parameter from Bedrock inference config (RooCodeInc#8388) Co-authored-by: Matt Rubens <[email protected]> * chore: add changeset for v3.28.13 (RooCodeInc#8393) * Changeset version bump (RooCodeInc#8394) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * feat: add GLM-4.6 model support for z.ai provider (RooCodeInc#8408) Co-authored-by: Roo Code <[email protected]> * chore: add changeset for v3.28.14 (RooCodeInc#8413) * Changeset version bump (RooCodeInc#8414) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * A couple more sonnet 4.5 fixes (RooCodeInc#8421) * chore: Remove unsupported Gemini 2.5 Flash Image Preview free model (RooCodeInc#8359) * Include reasoning messages in cloud tasks (RooCodeInc#8401) * fix: show send button when only images are selected in chat textarea (RooCodeInc#8423) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]> * Add structured data to the homepage (RooCodeInc#8427) Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> * fix(ui): disable send button when no input content and update tests * fix: Addresses overeager 'there are unsaved changes' dialog in settings (RooCodeInc#8410) Fixes overeager 'there are unsaved changes' dialog in settings * feat: add UsageStats schema and type (RooCodeInc#8441) feat: add UsageStats schema and type to cloud.ts Co-authored-by: Roo Code <[email protected]> * Release: v1.80.0 (RooCodeInc#8442) chore: bump version to v1.80.0 * feat: add new DeepSeek and GLM models with detailed descriptions to the Chutes provider (RooCodeInc#8467) * Deprecate free grok 4 fast (RooCodeInc#8481) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * fix: improve save button activation in prompts settings (RooCodeInc#5780) (RooCodeInc#8267) Co-authored-by: MuriloFP <[email protected]> Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * fix: properly reset cost limit tracking when user clicks "Reset and Continue" (RooCodeInc#6890) Co-authored-by: Roo Code <[email protected]> Co-authored-by: daniel-lxs <[email protected]> * chore(deps): update dependency vite to v6.3.6 [security] (RooCodeInc#7838) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency glob to v11.0.3 (RooCodeInc#7767) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: add changeset for v3.28.15 (RooCodeInc#8491) * Changeset version bump (RooCodeInc#8492) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * Clamp GPT-5 max output tokens to 20% of context window (RooCodeInc#8495) * fix: add ollama and lmstudio to MODELS_BY_PROVIDER (RooCodeInc#8511) Co-authored-by: Roo Code <[email protected]> * Release: v1.81.0 (RooCodeInc#8519) * Add the parent task ID in telemetry (RooCodeInc#8532) * Release: v1.82.0 (RooCodeInc#8535) * feat: Experiment: Show a bit of stats in Cloud tab to help users discover there's more in Cloud (RooCodeInc#8415) Co-authored-by: Roo Code <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: SannidhyaSah <[email protected]> Co-authored-by: John Richmond <[email protected]> * Revert "feat: Experiment: Show a bit of stats in Cloud tab to help users discover there's more in Cloud" (RooCodeInc#8559) * Identify cloud tasks in the extension bridge (RooCodeInc#8539) * Revert "Clamp GPT-5 max output tokens to 20% of context window" (RooCodeInc#8582) * feat: Add Claude Sonnet 4.5 1M context window support for Claude Code… (RooCodeInc#8586) feat: Add Claude Sonnet 4.5 1M context window support for Claude Code provider * chore: add changeset for v3.28.16 (RooCodeInc#8592) * Changeset version bump (RooCodeInc#8593) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> * fix(i18n): Update zh-TW run command title (RooCodeInc#8631) * feat(commands, webview): Add TDD built-in command; Refactor welcome tips and test guide definition * refactor(project-wiki): separate command from subtask initialization * feat(command): update built-in commands count and names in tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]> Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> Co-authored-by: daniel-lxs <[email protected]> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: Bruno Bergher <[email protected]> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Daniel <[email protected]> Co-authored-by: Hannes Rudolph <[email protected]> Co-authored-by: ItsOnlyBinary <[email protected]> Co-authored-by: John Richmond <[email protected]> Co-authored-by: Chris Estreich <[email protected]> Co-authored-by: Mubeen Zulfiqar <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: NaccOll <[email protected]> Co-authored-by: James Edward Dillard <[email protected]> Co-authored-by: Jorge Piedrahita Ortiz <[email protected]> Co-authored-by: John Costa <[email protected]> Co-authored-by: SannidhyaSah <[email protected]> Co-authored-by: Mohammad Danaee nia <[email protected]> Co-authored-by: MuriloFP <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Colby Serpa <[email protected]> Co-authored-by: Peter Dave Hello <[email protected]>
1 parent ab6f92d commit 9d3155e

File tree

13 files changed

+175
-273
lines changed

13 files changed

+175
-273
lines changed

src/__tests__/project-wiki-command.spec.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { getCommands, getCommand } from "../services/command/commands"
2-
import { ensureProjectWikiCommandExists } from "../core/costrict/wiki/projectWikiHelpers"
2+
import { ensureProjectWikiSubtasksExists } from "../core/costrict/wiki/projectWikiHelpers"
33
import { projectWikiCommandName } from "../core/costrict/wiki/projectWikiHelpers"
44

55
describe("Project Wiki Command Integration", () => {
66
const testCwd = process.cwd()
77

8-
describe("动态命令初始化", () => {
9-
it("应该能够初始化 project-wiki 命令而不抛出错误", async () => {
10-
// 测试 ensureProjectWikiCommandExists 函数
11-
await expect(ensureProjectWikiCommandExists()).resolves.not.toThrow()
8+
describe("子任务文件初始化", () => {
9+
it("应该能够初始化 project-wiki 子任务文件而不抛出错误", async () => {
10+
// 测试 ensureProjectWikiSubtasksExists 函数
11+
await expect(ensureProjectWikiSubtasksExists()).resolves.not.toThrow()
1212
})
1313

1414
it("getCommands() 应该包含 project-wiki 命令", async () => {
15-
// 确保命令已初始化
16-
await ensureProjectWikiCommandExists()
15+
// 确保子任务文件已初始化
16+
await ensureProjectWikiSubtasksExists()
1717

1818
// 获取所有命令
1919
const commands = await getCommands(testCwd)
@@ -29,50 +29,51 @@ describe("Project Wiki Command Integration", () => {
2929

3030
if (projectWikiCommand) {
3131
expect(projectWikiCommand.name).toBe(projectWikiCommandName)
32-
expect(projectWikiCommand.source).toBe("global")
32+
// 命令来源可能是 built-in 或 global,取决于是否存在全局文件
33+
expect(["built-in", "global"]).toContain(projectWikiCommand.source)
3334
expect(typeof projectWikiCommand.content).toBe("string")
3435
expect(projectWikiCommand.content.length).toBeGreaterThan(0)
35-
expect(projectWikiCommand.filePath).toContain("project-wiki.md")
3636
}
3737
})
3838

3939
it("getCommand() 应该能够获取 project-wiki 命令", async () => {
40-
// 确保命令已初始化
41-
await ensureProjectWikiCommandExists()
40+
// 确保子任务文件已初始化
41+
await ensureProjectWikiSubtasksExists()
4242

4343
// 获取特定命令
4444
const command = await getCommand(testCwd, projectWikiCommandName)
4545

4646
// 验证命令存在且正确
4747
expect(command).toBeDefined()
4848
expect(command?.name).toBe(projectWikiCommandName)
49-
expect(command?.source).toBe("global")
49+
// 命令来源可能是 built-in 或 global,取决于是否存在全局文件
50+
expect(["built-in", "global"]).toContain(command?.source)
5051
expect(typeof command?.content).toBe("string")
5152
expect(command?.content.length).toBeGreaterThan(0)
5253
})
5354
})
5455

5556
describe("错误处理机制", () => {
56-
it("即使 ensureProjectWikiCommandExists 失败,getCommands 也应该正常工作", async () => {
57+
it("即使 ensureProjectWikiSubtasksExists 失败,getCommands 也应该正常工作", async () => {
5758
// 这个测试验证错误隔离机制
58-
// 即使动态命令初始化失败,其他命令仍应正常工作
59+
// 即使子任务文件初始化失败,其他命令仍应正常工作
5960
const commands = await getCommands(testCwd)
6061

6162
// 应该返回数组(可能为空,但不应该抛出错误)
6263
expect(Array.isArray(commands)).toBe(true)
6364
})
6465

65-
it("应该能够处理重复的命令初始化调用", async () => {
66+
it("应该能够处理重复的子任务文件初始化调用", async () => {
6667
// 多次调用应该不会出错
67-
await expect(ensureProjectWikiCommandExists()).resolves.not.toThrow()
68-
await expect(ensureProjectWikiCommandExists()).resolves.not.toThrow()
69-
await expect(ensureProjectWikiCommandExists()).resolves.not.toThrow()
68+
await expect(ensureProjectWikiSubtasksExists()).resolves.not.toThrow()
69+
await expect(ensureProjectWikiSubtasksExists()).resolves.not.toThrow()
70+
await expect(ensureProjectWikiSubtasksExists()).resolves.not.toThrow()
7071
})
7172
})
7273

7374
describe("命令内容验证", () => {
7475
it("project-wiki 命令应该包含预期的内容结构", async () => {
75-
await ensureProjectWikiCommandExists()
76+
await ensureProjectWikiSubtasksExists()
7677
const command = await getCommand(testCwd, projectWikiCommandName)
7778

7879
expect(command).toBeDefined()

src/api/providers/zgsm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ export class ZgsmAiHandler extends BaseProvider implements SingleCompletionHandl
535535
requestId,
536536
cachedClientId,
537537
cachedWorkspacePath,
538-
"system",
538+
"user",
539539
),
540540
},
541541
timeout: 20000,

src/core/costrict/activate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import { writeCostrictAccessToken } from "./codebase-index/utils"
3838
import { getPanel } from "../../activate/registerCommands"
3939
import { t } from "../../i18n"
4040
import prettyBytes from "pretty-bytes"
41-
import { ensureProjectWikiCommandExists } from "./wiki/projectWikiHelpers"
41+
import { ensureProjectWikiSubtasksExists } from "./wiki/projectWikiHelpers"
4242

4343
const HISTORY_WARN_SIZE = 1000 * 1000 * 1000 * 3
4444

@@ -212,8 +212,8 @@ export async function activate(
212212
setTimeout(() => {
213213
loginTip()
214214

215-
// init project-wiki command.
216-
ensureProjectWikiCommandExists()
215+
// init project-wiki subtasks.
216+
ensureProjectWikiSubtasksExists()
217217
}, 2000)
218218
}
219219

src/core/costrict/wiki/__tests__/projectWikiHelpers.spec.ts

Lines changed: 44 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ vi.mock("../wiki-prompts/subtasks/constants", () => ({
6161

6262
vi.mock("../wiki-prompts/project_wiki", () => ({
6363
projectWikiVersion: "v1.0.1",
64-
PROJECT_WIKI_TEMPLATE: "---\ndescription: \"项目深度分析与知识文档生成\"\nversion: v1.0.1\n---\n# 测试模板",
64+
PROJECT_WIKI_TEMPLATE: '---\ndescription: "项目深度分析与知识文档生成"\nversion: v1.0.1\n---\n# 测试模板',
6565
}))
6666

6767
vi.mock("../wiki-prompts/subtasks/01_Project_Overview_Analysis", () => ({
@@ -110,7 +110,7 @@ vi.mock("../wiki-prompts/subtasks/11_Project_Rules_Generation", () => ({
110110

111111
// 导入模块
112112
import * as fs from "fs"
113-
import { ensureProjectWikiCommandExists, setLogger } from "../projectWikiHelpers"
113+
import { ensureProjectWikiSubtasksExists, setLogger } from "../projectWikiHelpers"
114114

115115
describe("projectWikiHelpers", () => {
116116
beforeEach(() => {
@@ -119,55 +119,47 @@ describe("projectWikiHelpers", () => {
119119
setLogger(mockLogger)
120120
})
121121

122-
describe("ensureProjectWikiCommandExists", () => {
123-
it("应该在文件不存在时创建项目wiki命令", async () => {
124-
// Mock fs.access 抛出错误表示文件不存在
125-
vi.mocked(fs.promises.access).mockRejectedValue(new Error("File not found"))
122+
describe("ensureProjectWikiSubtasksExists", () => {
123+
it("应该在子任务目录不存在时创建子任务文件", async () => {
124+
// Mock fs.stat 抛出错误表示目录不存在
126125
vi.mocked(fs.promises.stat).mockRejectedValue(new Error("Directory not found"))
127126
vi.mocked(fs.promises.mkdir).mockResolvedValue(undefined)
128127
vi.mocked(fs.promises.writeFile).mockResolvedValue(undefined)
129128
vi.mocked(fs.promises.rm).mockResolvedValue(undefined)
130129

131-
await ensureProjectWikiCommandExists()
130+
await ensureProjectWikiSubtasksExists()
132131

133-
expect(fs.promises.mkdir).toHaveBeenCalledWith("/home/user/.roo/commands", { recursive: true })
132+
expect(fs.promises.mkdir).toHaveBeenCalledWith("/home/user/.roo/commands/project-wiki-tasks/", {
133+
recursive: true,
134+
})
134135
expect(fs.promises.writeFile).toHaveBeenCalled()
135-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Starting ensureProjectWikiCommandExists...")
136+
expect(mockLogger.info).toHaveBeenCalledWith(
137+
"[projectWikiHelpers] Starting ensureProjectWikiSubtasksExists...",
138+
)
136139
})
137140

138-
it("应该在版本不匹配时重新创建文件", async () => {
139-
// Mock 文件存在但版本不匹配
140-
vi.mocked(fs.promises.access).mockResolvedValue(undefined)
141-
vi.mocked(fs.promises.readFile).mockResolvedValue(`---
142-
description: "项目深度分析与知识文档生成"
143-
version: "v1.0.0"
144-
---
145-
# 旧版本模板`)
141+
it("应该在子任务文件不完整时重新创建", async () => {
142+
// Mock 子任务目录存在但文件不完整
146143
vi.mocked(fs.promises.stat).mockResolvedValue({
147144
isDirectory: () => true,
148145
} as any)
149146
vi.mocked(fs.promises.readdir).mockResolvedValue([
150147
"01_Project_Overview_Analysis.md",
151148
"02_Overall_Architecture_Analysis.md",
149+
// 缺少其他文件
152150
] as any)
153151
vi.mocked(fs.promises.mkdir).mockResolvedValue(undefined)
154152
vi.mocked(fs.promises.writeFile).mockResolvedValue(undefined)
155153
vi.mocked(fs.promises.rm).mockResolvedValue(undefined)
156154

157-
await ensureProjectWikiCommandExists()
155+
await ensureProjectWikiSubtasksExists()
158156

159157
expect(fs.promises.rm).toHaveBeenCalled()
160158
expect(fs.promises.writeFile).toHaveBeenCalled()
161159
})
162160

163-
it("应该正确处理文件存在的情况", async () => {
164-
// Mock 文件存在的情况
165-
vi.mocked(fs.promises.access).mockResolvedValue(undefined)
166-
vi.mocked(fs.promises.readFile).mockResolvedValue(`---
167-
description: "项目深度分析与知识文档生成"
168-
version: "v1.0.1"
169-
---
170-
# 当前版本模板`)
161+
it("应该正确处理子任务文件完整的情况", async () => {
162+
// Mock 子任务文件完整的情况
171163
vi.mocked(fs.promises.stat).mockResolvedValue({
172164
isDirectory: () => true,
173165
} as any)
@@ -188,112 +180,70 @@ version: "v1.0.1"
188180
vi.mocked(fs.promises.writeFile).mockResolvedValue(undefined)
189181
vi.mocked(fs.promises.rm).mockResolvedValue(undefined)
190182

191-
await ensureProjectWikiCommandExists()
183+
await ensureProjectWikiSubtasksExists()
192184

193185
// 验证启动日志被调用
194-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Starting ensureProjectWikiCommandExists...")
195-
// 验证设置命令的日志被调用
196-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Setting up project-wiki command...")
197-
// 验证写文件操作被调用
198-
expect(fs.promises.writeFile).toHaveBeenCalled()
199-
})
200-
201-
it("应该在子任务目录缺少文件时重新创建", async () => {
202-
// Mock 主文件存在但子任务目录缺少文件
203-
vi.mocked(fs.promises.access).mockResolvedValue(undefined)
204-
vi.mocked(fs.promises.readFile).mockResolvedValue(`---
205-
description: "项目深度分析与知识文档生成"
206-
version: "v1.0.1"
207-
---
208-
# 当前版本模板`)
209-
vi.mocked(fs.promises.stat).mockResolvedValue({
210-
isDirectory: () => true,
211-
} as any)
212-
vi.mocked(fs.promises.readdir).mockResolvedValue([
213-
"01_Project_Overview_Analysis.md",
214-
// 缺少其他文件
215-
] as any)
216-
vi.mocked(fs.promises.mkdir).mockResolvedValue(undefined)
217-
vi.mocked(fs.promises.writeFile).mockResolvedValue(undefined)
218-
vi.mocked(fs.promises.rm).mockResolvedValue(undefined)
219-
220-
await ensureProjectWikiCommandExists()
221-
222-
expect(fs.promises.rm).toHaveBeenCalled()
223-
expect(fs.promises.writeFile).toHaveBeenCalled()
186+
expect(mockLogger.info).toHaveBeenCalledWith(
187+
"[projectWikiHelpers] Starting ensureProjectWikiSubtasksExists...",
188+
)
189+
// 验证子任务已存在的日志被调用
190+
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] project-wiki subtasks already exist")
191+
// 验证不需要重新生成文件
192+
expect(fs.promises.writeFile).not.toHaveBeenCalled()
224193
})
225194

226195
it("应该处理错误情况", async () => {
227196
const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {})
228-
197+
229198
// Mock mkdir 抛出错误
230199
vi.mocked(fs.promises.mkdir).mockRejectedValue(new Error("Permission denied"))
231200

232-
await ensureProjectWikiCommandExists()
201+
await ensureProjectWikiSubtasksExists()
233202

234203
expect(consoleSpy).toHaveBeenCalledWith(
235-
"[commands] Failed to initialize project-wiki command:",
236-
expect.stringContaining("Permission denied")
204+
"[commands] Failed to initialize project-wiki subtasks:",
205+
expect.stringContaining("Permission denied"),
237206
)
238207

239208
consoleSpy.mockRestore()
240209
})
241210

242-
it("应该正确处理前置matter解析错误", async () => {
243-
// Mock 文件存在但前置matter格式错误
244-
vi.mocked(fs.promises.access).mockResolvedValue(undefined)
245-
vi.mocked(fs.promises.readFile).mockResolvedValue(`# 没有前置matter的文件`)
246-
vi.mocked(fs.promises.stat).mockResolvedValue({
247-
isDirectory: () => true,
248-
} as any)
249-
vi.mocked(fs.promises.readdir).mockResolvedValue([] as any)
250-
vi.mocked(fs.promises.mkdir).mockResolvedValue(undefined)
251-
vi.mocked(fs.promises.writeFile).mockResolvedValue(undefined)
252-
vi.mocked(fs.promises.rm).mockResolvedValue(undefined)
253-
254-
await ensureProjectWikiCommandExists()
255-
256-
// 验证启动日志被调用
257-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Starting ensureProjectWikiCommandExists...")
258-
// 验证设置命令的日志被调用
259-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Setting up project-wiki command...")
260-
// 验证写文件操作被调用
261-
expect(fs.promises.writeFile).toHaveBeenCalled()
262-
})
263-
264211
it("应该正确处理部分子任务文件生成失败的情况", async () => {
265-
// Mock 文件不存在,需要创建
266-
vi.mocked(fs.promises.access).mockRejectedValue(new Error("File not found"))
212+
// Mock 子任务目录不存在,需要创建
267213
vi.mocked(fs.promises.stat).mockRejectedValue(new Error("Directory not found"))
268214
vi.mocked(fs.promises.mkdir).mockResolvedValue(undefined)
269215
vi.mocked(fs.promises.writeFile)
270-
.mockResolvedValueOnce(undefined) // 主文件成功
271216
.mockRejectedValueOnce(new Error("Write failed")) // 第一个子任务文件失败
272217
.mockResolvedValue(undefined) // 其他文件成功
273218
vi.mocked(fs.promises.rm).mockResolvedValue(undefined)
274219

275-
await ensureProjectWikiCommandExists()
220+
await ensureProjectWikiSubtasksExists()
276221

277222
// 验证启动和设置日志被调用
278-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Starting ensureProjectWikiCommandExists...")
279-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Setting up project-wiki command...")
223+
expect(mockLogger.info).toHaveBeenCalledWith(
224+
"[projectWikiHelpers] Starting ensureProjectWikiSubtasksExists...",
225+
)
226+
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Setting up project-wiki subtasks...")
280227
// 验证警告日志被调用(部分文件生成失败)
281228
expect(mockLogger.warn).toHaveBeenCalledWith(expect.stringContaining("Failed to generate"))
282229
})
283230

284231
it("应该正确处理Promise.allSettled的混合结果", async () => {
285232
// Mock 混合的成功和失败情况
286-
vi.mocked(fs.promises.access).mockRejectedValue(new Error("File not found"))
287233
vi.mocked(fs.promises.stat).mockRejectedValue(new Error("Directory not found"))
288234
vi.mocked(fs.promises.mkdir).mockResolvedValue(undefined)
289235
vi.mocked(fs.promises.writeFile).mockResolvedValue(undefined)
290236
vi.mocked(fs.promises.rm).mockResolvedValue(undefined)
291237

292-
await ensureProjectWikiCommandExists()
238+
await ensureProjectWikiSubtasksExists()
293239

294240
// 验证基本流程被执行
295-
expect(mockLogger.info).toHaveBeenCalledWith("[projectWikiHelpers] Starting ensureProjectWikiCommandExists...")
296-
expect(fs.promises.mkdir).toHaveBeenCalledWith("/home/user/.roo/commands", { recursive: true })
241+
expect(mockLogger.info).toHaveBeenCalledWith(
242+
"[projectWikiHelpers] Starting ensureProjectWikiSubtasksExists...",
243+
)
244+
expect(fs.promises.mkdir).toHaveBeenCalledWith("/home/user/.roo/commands/project-wiki-tasks/", {
245+
recursive: true,
246+
})
297247
})
298248
})
299249

@@ -311,4 +261,4 @@ version: "v1.0.1"
311261
expect(() => setLogger(testLogger)).not.toThrow()
312262
})
313263
})
314-
})
264+
})

0 commit comments

Comments
 (0)