Commit graph

508 commits

Author SHA1 Message Date
Tomasz Stefaniak
e9e4c9dd91 feat: org switching 2025-08-06 10:20:48 -07:00
Tomasz Stefaniak
746d71324e improv: switch orgs 2025-08-06 09:37:29 -07:00
Tomasz Stefaniak
da655bede9 Merge branch 'main' into audit-command-line-flags 2025-08-05 23:30:08 -07:00
Tomasz Stefaniak
7a33f12ce7
Merge pull request #147 from continuedev/fix-config-flag-ignored
Fix --config flag being ignored and falling back silently
2025-08-05 23:20:41 -07:00
Tomasz Stefaniak
bd9b09530c fix: imports 2025-08-05 23:11:39 -07:00
Tomasz Stefaniak
71e04946b5 fix: missing files 2025-08-05 23:07:47 -07:00
Tomasz Stefaniak
df496c0765 fix: lint 2025-08-05 23:04:26 -07:00
Tomasz Stefaniak
f55cba4e43 Merge branch 'main' into sentry 2025-08-05 22:55:33 -07:00
Patrick Erichsen
e0dd68f069 fix: Fix failing tests in CI environment by adding proper mocks
The initializeServices tests were failing in CI with "Response returned an
error code" because the refactored function now calls onboarding/auth modules
that make real API calls.

Changes:
- Added mocks for onboarding.js and auth/workos.js modules
- Enhanced modeService mock to include getToolPermissionService method
- Added serviceContainer mocks to prevent real service initialization
- Updated all test cases to use headless: true to skip onboarding flow
- Fixed test expectations to include isHeadless parameter

This ensures tests run in isolation without making network requests,
preventing CI failures due to authentication or network issues.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 17:05:43 -07:00
Patrick Erichsen
0f377203e5 fix: Improve Windows path detection in configLoader
Enhanced isFilePath function to properly detect Windows absolute paths,
UNC paths, and paths with file extensions. This fixes test failures on
Windows where paths like "C:\Users\..." were incorrectly treated as
assistant slugs instead of file paths.

Changes:
- Added Windows drive letter pattern detection (C:\, D:\, etc.)
- Added UNC path detection (\\server\share)
- Added file extension detection (.yaml, .yml, .json)

Fixes Windows CI test failure: "Invalid assistant slug format" error
when --config points to non-existent Windows file paths.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 16:59:25 -07:00
Patrick Erichsen
16c01b3507 fix: Add TTY environment detection to prevent CI failures
Added comprehensive environment detection in runOnboardingFlow to skip
interactive prompts in test/CI environments. Detects:
- NODE_ENV=test
- CI=true
- VITEST=true
- GITHUB_ACTIONS=true
- \!process.stdin.isTTY

This prevents "The current environment doesn't support interactive
reading from TTY" errors in GitHub Actions CI.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 16:57:15 -07:00
Patrick Erichsen
3549ba75e1 Fix CI test failures due to onboarding TTY issues
- Add environment detection in runOnboardingFlow to skip interactive prompts in CI/test environments
- Check for NODE_ENV=test, CI=true, VITEST=true, or lack of TTY
- Prevents "The current environment doesn't support interactive reading from TTY" errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 16:49:44 -07:00
Patrick Erichsen
9218172625 fix: resolve remaining ESLint issues in audit-command-line-flags
- Fix import order issues across multiple files
- Remove unused imports (loadAuthConfig, ValidationOptions)
- Add proper import group separations
- All lint checks and tests now pass

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 16:33:27 -07:00
Patrick Erichsen
12c246cfd7 Fix import order issues in onboarding.test.ts
ESLint was reporting import order violations. Fixed by running
eslint --fix which properly ordered the imports according to
the project's import order rules.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 16:19:44 -07:00
Patrick Erichsen
776def758a Fix Jest import in onboarding.test.ts - change to vitest
The test file was still importing from '@jest/globals' instead of 'vitest',
causing CI failures. Updated to use vitest imports to match the project's
migration from Jest to Vitest.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 16:16:20 -07:00
Dallin Romney
d03a726dd3 fix: help tests 2025-08-05 16:13:06 -07:00
Dallin Romney
38eb5d8960 Merge branch 'main' of https://github.com/continuedev/cli into pe/readable-help-text 2025-08-05 16:10:08 -07:00
Chad Metcalf
8536dc3c8c
fix: keep slash command suggestions visible when typing exact command names (#157)
Previously, typing "/org" would hide the suggestion immediately upon
completion. Now suggestions only disappear when user presses space
or Enter, making it clearer that the command is available to execute.

Fixes UX issue where users lose visual confirmation of valid commands.
2025-08-05 16:04:26 -07:00
Patrick Erichsen
783c9c10ac Resolve merge conflicts between sentry and main branch
Merged Sentry error tracking features with main branch changes:
- Integrated Sentry service with main branch logger architecture
- Preserved Sentry error capture functionality with improved error handling
- Combined import patterns and maintained compatibility
- Fixed logger.ts conflicts to include both Sentry integration and Winston logging

The merge conflict was handled by claude, please verify the changes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 15:58:13 -07:00
Patrick Erichsen
fbf99c2ba1 Resolve merge conflicts between fix-config-flag-ignored and main branch
Merged explicit config path error handling with main branch changes:
- Preserved error handling for explicit --config flag failures
- Integrated with main branch service initialization patterns
- Maintained proper error propagation for config validation

The merge conflict was handled by claude, please verify the changes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 15:54:15 -07:00
Patrick Erichsen
77fc19f396 Resolve merge conflicts with main branch
Merge conflicts were handled by Claude AI - please verify the changes:
- src/commands/chat.ts: Integrated flag processing with main branch changes
- src/commands/serve.ts: Updated logger import and integrated flag processing
- src/services/index.ts: Updated logger import and maintained initialization logic
- src/services/index.test.ts: Accepted main branch version

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 15:52:52 -07:00
Tomasz Stefaniak
1fee6fe16f improv: lint 2025-08-05 14:06:08 -07:00
Nate Sesti
194f699b40
Merge pull request #156 from continuedev/auto-compact
feat: compact slash command
2025-08-05 07:38:02 -07:00
Nate
49ff60026c fix: address feedback 2025-08-05 10:32:22 -04:00
Nate
73135ffdc5 fix: address feedback 2025-08-05 10:23:48 -04:00
Nate
0b7880bff1 auto-compaction 2025-08-05 09:57:25 -04:00
Patrick Erichsen
b922f2feec fix: make /help more readable 2025-08-04 19:07:25 -07:00
Nate
e27e1db6d6 feat: compact slash command 2025-08-04 15:53:34 -04:00
Chad Metcalf
311d5ee8b2
fix: prevent Bash tool from being presented in plan mode
Fix service initialization race condition where getAllTools() would return
all tools when ToolPermissionService wasn't ready, causing plan mode to
incorrectly include excluded tools like Bash.

The issue occurred in GitHub Actions where `cn -p` (plan mode) should exclude
Bash tool, but due to timing issues, Bash was being presented to the LLM and
then failing during execution with permission errors.

Changes:
- Fix getAllTools() to properly pass permissions to filterExcludedTools()
- Throw descriptive error when service not initialized instead of fallback
- Add comprehensive regression tests covering all modes and edge cases

Fixes automated PR review failures in GitHub Actions workflows.
2025-08-04 10:15:16 -07:00
Dallin Romney
4caa49b1c1 merge: main 2025-08-04 08:26:37 -07:00
Nate
b7e5038891 Reorder system commands for better UX 2025-08-03 21:55:03 -04:00
Nate Sesti
8cfc2f0965
Merge pull request #146 from continuedev/standardize-services-actual
refactor: base service class + migrate to vitest
2025-08-03 18:47:36 -07:00
Nate
889421049f fix tool permissions bug 2025-08-03 19:19:46 -04:00
Chad Metcalf
fd848a1ad8
test: fix CI failure by forcing headless mode in services tests
The services/index.test.ts was failing in CI because it triggers the onboarding
flow which uses readlineSync, but CI environments don't have TTY access.

These tests are specifically for testing mode conversion logic (plan/auto/normal
to readonly/auto flags), not onboarding functionality. Onboarding is properly
tested in the dedicated onboarding.test.ts file.

- Add headless: true flag to all initializeServices() calls in tests
- This skips the onboarding flow and focuses on the actual logic being tested
- Maintains proper test coverage while fixing CI compatibility
2025-08-03 16:01:38 -07:00
Chad Metcalf
b589f8f2c2
test: clean up onboarding tests per code review feedback
- Replace fail() calls with expect().rejects.toThrow() pattern
- Fix test syntax error with toThrow callback
- Consolidate redundant error handling in tests
2025-08-03 15:50:02 -07:00
Nate
52cefcfa02 refactor: avoid double name property for tools. only use "name" 2025-08-03 18:43:33 -04:00
Chad Metcalf
7fea7fb369
feat: add comprehensive centralized command line flag validation
Replaces scattered ad-hoc validation with a centralized, testable validation
system. Provides consistent error messages and comprehensive coverage of
flag combinations and edge cases.

Changes:
- Add flagValidator module with comprehensive validation functions
- Test coverage for all validation scenarios (17 tests)
- Replace scattered validation in index.ts with centralized validateFlags()
- Validate flag dependencies (--format/--silent require -p)
- Validate conflicting flags (--readonly vs --auto)
- Validate permission flag values (no empty tool names)
- Consistent error formatting and exit handling

All existing validation behavior preserved while adding new validations
for edge cases like empty permission tool names.
2025-08-03 15:34:21 -07:00
Chad Metcalf
94dea97540
refactor: unify TUI and headless service initialization paths
Eliminates major code duplication between TUI and headless modes by handling
onboarding internally within initializeServices(). Previously TUI mode called
initializeWithOnboarding() then startTUIChat() called initializeServices()
again, while headless mode called initializeServices() directly.

Changes:
- Add skipOnboarding option to ServiceInitOptions
- Modify initializeServices() to handle onboarding internally for TUI mode
- Remove duplicate initializeWithOnboarding() call from chat.ts TUI path
- Update startTUIChat() to skip initialization when already done
- Update serve.ts to use shared flag processing from Phase 1

This eliminates the dual initialization paths while preserving all existing
behavior. TUI mode now has single initialization path with proper onboarding.
2025-08-03 15:23:09 -07:00
Chad Metcalf
f1961e7e54
refactor: extract shared flag processing logic to eliminate duplication
Extract common flag processing logic from TUI and headless code paths into
shared flagProcessor module. This eliminates code duplication where both
paths independently converted readonly/auto flags to mode and structured
permission overrides.

Changes:
- Add src/flags/flagProcessor.ts with shared flag processing functions
- Replace duplicated logic in chat.ts (lines 168-173 and 259-264)
- Add comprehensive unit tests for all flag processing scenarios
- Add validation for conflicting --readonly and --auto flags

This is a pure refactor with no behavior changes. All existing functionality
preserved while eliminating 20+ lines of duplicated code.
2025-08-03 15:14:54 -07:00
Nate
c0e292e390 fix tests 2025-08-03 17:43:42 -04:00
Chad Metcalf
aa06fd90e0
fix: respect --config flag instead of falling back to default config
Fixes issue where the --config flag was being ignored and the CLI would
silently fall back to ~/.continue/config.yaml instead of the specified
config file.

Changes:
- Add proper error handling in runNormalFlow() for explicit --config failures
- Fix config precedence in initializeServices() to prefer --config over saved state
- Add integration tests to verify config loading behavior

Resolves config loading falling back silently when explicit config path fails.
2025-08-03 12:57:11 -07:00
Nate
a9e6cd7352 fix tool permissions bug 2025-08-02 20:12:35 -04:00
Nate
bbab58e13c Merge branch 'standardize-services-actual' of https://github.com/continuedev/cli into standardize-services-actual 2025-08-02 19:37:10 -04:00
Nate
70956fbcf3 address feedback 2025-08-02 19:36:56 -04:00
Nate Sesti
898936240c
Update src/services/ConfigService.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-02 16:31:56 -07:00
Nate Sesti
d4e84b20ac
Update src/services/BaseService.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-02 16:31:49 -07:00
Nate Sesti
2c15a7ecfa
Update src/util/exponentialBackoff.test.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-02 16:31:37 -07:00
Nate Sesti
0347242d91
Update src/services/ToolPermissionService.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-02 16:31:12 -07:00
Nate Sesti
3a6992cf82
Update src/services/ToolPermissionService.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-08-02 16:30:41 -07:00
Nate
c621961f8d refactor: base service class + migrate to vitest 2025-08-02 19:17:46 -04:00