Commit graph

993 commits

Author SHA1 Message Date
Dallin Romney
7e6c974e4d context filled text, pruning warning 2025-07-17 03:12:50 +02:00
Jazzcort
d130fef631 Feat: adding a warning message system and implementing compile chat mechanism
This feature include the following changes:
  - Implemented llm/compileChat that gives the webview the ability to precompile the chat messages
    before sending them to llm/streamChat where the webview can gather the pruning information and
    provide users better guides.

  - Added a optional parameter to llm/streamChat that can be used to indicate whether the chat
    messages being passed is procompiled or not, so we don't compile the chat messages twice.
    Because it's an optional parameter, we don't affect the behavior of llm/stream when it's
    called at other places.

  - Added a warning message box for the last ContinueInputBox which will display the warning
    messages and also provide some useful guides.

https://github.com/Granite-Code/granite-code/issues/22
2025-07-16 09:09:26 -04:00
Patrick Erichsen
669769b73e fix test errors and linting 2025-07-13 23:24:05 -07:00
Patrick Erichsen
7e90887e2b fix failing tests 2025-07-13 22:23:24 -07:00
Patrick Erichsen
cd6ceebcbf fix: render all pending apply states 2025-07-13 18:41:56 -07:00
Patrick Erichsen
70a5365dfc Update GeneratingIndicator.tsx 2025-07-11 21:39:34 -07:00
Patrick Erichsen
0274041f3c Merge branch 'main' into pe/parallel-tool-calling 2025-07-11 21:33:38 -07:00
Patrick Erichsen
326440f656 cleanup group header 2025-07-10 22:18:28 -07:00
uinstinct
dfbc0253b2 skip current file addition when there is content in editor 2025-07-11 10:20:48 +05:30
Patrick Erichsen
7da112bbfa merge main 2025-07-10 17:29:08 -07:00
Patrick Erichsen
e100d9f8ad improve tool group ui 2025-07-10 16:59:04 -07:00
Patrick Erichsen
77a1482c09 UI polish 2025-07-10 14:56:43 -07:00
Dallin Romney
55504f9bf1 fix cmd backspace 2025-07-10 14:13:53 -07:00
Patrick Erichsen
f573597b44 Fix parallel tool calls accept/reject issue and refactor selectors
- Fixed utility functions to find tool calls in correct assistant message instead of last history item
- Enhanced PendingToolCallToolbar to handle individual tool call actions properly
- Added comprehensive tests for multiple tool call scenarios
- Consolidated tool call selectors into single file with cleaner naming
- Added mock support for tools/call endpoint to enable proper testing
- Fixed streamResponseAfterToolCall to wait for all parallel tool calls before continuing

This resolves the issue where accepting/rejecting one tool call would cause other pending tool calls to disappear from the UI.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 11:25:59 -07:00
Patrick Erichsen
a9e3a56a61 Fix parallel tool calls core processing and Claude API compatibility
## Key Issues Fixed

### 1. Tool Output Matching Error
- **Problem**: `compileChatMessages` only processed the last tool message, causing "no tool call found to match tool output" errors
- **Solution**: Modified to collect and process all consecutive tool messages from the end
- **Files**: `core/llm/countTokens.ts` - Enhanced tool message collection and validation logic

### 2. Claude API Missing tool_result Blocks
- **Problem**: `flattenMessages` was merging adjacent tool messages, losing individual `toolCallId` properties
- **Solution**: Prevented merging of tool messages to preserve unique `toolCallId` for each `tool_result` block
- **Files**: `core/llm/messages.ts` - Added condition to prevent tool message merging

### 3. Token Counting for Parallel Tool Calls
- **Problem**: Token counting only considered the last tool message
- **Solution**: Added logic to count tokens for all tool messages in parallel scenarios
- **Files**: `core/llm/countTokens.ts` - Enhanced token counting for multiple tool messages

## Test Coverage
- Added comprehensive tests for parallel tool call scenarios
- Tests verify correct message structure for Claude API format
- All existing functionality preserved with backward compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 21:18:48 -07:00
Patrick Erichsen
c49f8412c3 Revert streaming fixes and preserve parallel tool calls progress
- Reverted ID-based streaming logic back to index-based approach
- Reverted permission processing changes
- Preserved existing parallel tool calls infrastructure
- Tests show tool calls are stored but not transitioning to "generated" status
- Ready to start fresh on the parallel tool calling issue

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 15:33:08 -07:00
Patrick Erichsen
bcf0969f34 Fix parallel tool calls utility functions and remove backward compatibility
- Fix findCurrentToolCalls to prioritize toolCallStates array over single toolCallState
- Remove all backward compatibility code for single toolCallState field
- Update clearDanglingMessages to only use toolCallStates array
- Clean up utility function tests to only test new behavior
- Add comprehensive test coverage for parallel tool calls functionality
- Suppress ProseMirror DOM errors in test environment
- Fix TypeScript errors in test files

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 13:52:44 -07:00
Patrick Erichsen
e3d6d166b4 Update PendingToolCallToolbar for parallel tool calls
- Changed from selectCurrentToolCall to selectCurrentToolCallsByStatus
- Show individual UI for each tool call requiring approval
- Display dynamic text: "1 pending tool call" vs "X pending tool calls"
- Individual approve/reject buttons for each tool call
- Added test IDs with toolCallId for specific tool testing
- Used only Tailwind classes, no styled components
- Returns null when no pending tool calls exist

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 13:19:49 -07:00
Patrick Erichsen
7cb78fe209 Rename callCurrentTool to callToolById for clarity
- Renamed function from callCurrentTool to callToolById to better reflect its purpose
- Updated function signature to accept toolCallId parameter for parallel tool execution
- Renamed file from callCurrentTool.ts to callToolById.ts
- Updated all import paths and call sites across codebase
- Verified TypeScript compilation passes
- All utility function tests still pass (21/21)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 13:11:43 -07:00
Keerthana Panyam
f50862f3c0 fix: prevent entering edit mode without editor
previously, edit mode was triggered even without an active editor and
the existing fallback mechanism failed silently if no active editor was
available.

this commit ensures that there is a validation check before entering
edit mode to ensure codeToEdit exists. It shows a toast message when
trying to switch to edit mode using '⌘I'. It also removes the fallback
check that occurs after edit mode is already activated.
2025-07-08 10:03:58 -04:00
Keerthana Panyam
ce2c3bf87e fix: prevent UI freeze when ⌘I pressed without active editor
pressing ⌘I in chat mode to switch to edit mode when no editor is
focused previously led to an unrecoverable error state in the secondary
sidebar.

this commit ensures that ⌘I action does nothing unless an editor is
focused, preventing the ui from freezing and allowing normal interaction
with the panel.
2025-07-08 09:49:39 -04:00
Nate Sesti
fbcc5a46b9
Merge pull request #6445 from continuedev/dallin/plan-mode
Plan Mode
2025-07-07 13:05:05 -07:00
Dallin Romney
b984c25b8f cubic-feedback 2025-07-07 10:58:40 -07:00
Dallin Romney
9b66433abc fix tool policies logic 2025-07-07 10:52:14 -07:00
Dallin Romney
b855109408 fix tool policies copy 2025-07-07 10:46:56 -07:00
Dallin Romney
518e18df43 update plan mode system message 2025-07-07 10:45:24 -07:00
Dallin Romney
be561ff54c add plan as actual mode in redux, add basePlanSystemMessage 2025-07-07 10:35:39 -07:00
Dallin Romney
8a7baaaa48 plan mode 2025-07-03 20:45:23 -07:00
Nate
6fa241a3e4 Merge branch 'main' into no-results-instruction 2025-07-03 19:08:13 -07:00
Nate Sesti
b002317ddf
Merge pull request #6318 from continuedev/nate/diff-tool
UI Polish
2025-07-03 18:12:41 -07:00
Nate Sesti
f92253c3f3
Merge pull request #6421 from continuedev/pe/rule-dialog
feat: generate rule dialog
2025-07-03 18:07:56 -07:00
Dallin Romney
1951259e53
Merge pull request #6382 from continuedev/dallin/tool-truncation-message
Add icon to truncate history at last tool call
2025-07-03 01:06:48 -07:00
Dallin Romney
0d00aa06c3
Merge pull request #6425 from continuedev/adarsh/feat/toolusage-fix
ToolUsage dev data updates
2025-07-02 20:10:03 -07:00
adarshramiyer
7fd52ff6c3 updated logToolUsage to use core "devdata/log" message 2025-07-02 19:49:48 -07:00
Patrick Erichsen
287839ccd8 Merge branch 'main' into pe/rule-dialog 2025-07-02 15:29:07 -07:00
Dallin Romney
9280800407
Merge pull request #6416 from continuedev/pe/drag-and-drop-fix
fix: pasting images
2025-07-02 15:21:56 -07:00
Patrick Erichsen
7208d14833 fix: pasting images 2025-07-02 14:01:52 -07:00
Nate Sesti
ecb15ffba7
Merge pull request #6355 from continuedev/pe/reasoning-btn-fix
chore: conditional tooltip on reasoning btn
2025-07-02 13:00:10 -07:00
Dallin Romney
f21b8c8ed0 merge main 2025-07-01 18:18:29 -07:00
Nate
ecca042749 hotfix to add query 2025-07-01 13:47:43 -07:00
Dallin Romney
eb7a5b63d5 move the tool truncation icon to a different PR 2025-07-01 12:40:46 -07:00
Dallin Romney
20503cd256 tool truncate history icon 2025-07-01 12:34:44 -07:00
Dallin Romney
6e3d42e80e update message cancelaltion and rejection logic 2025-07-01 01:57:41 -07:00
uinstinct
faa05ebc2c Merge branch 'main' into no-results-instruction 2025-07-01 13:34:32 +05:30
uinstinct
ed49258fd6 add isInAgentMode in retreival pipeline 2025-07-01 13:11:05 +05:30
Patrick Erichsen
44094aa163 feat: streaming input w/ history to rule dialog 2025-06-30 22:11:57 -07:00
Dallin Romney
fc9ef88668 merge main 2025-06-30 18:27:02 -07:00
Dallin Romney
ce681260d8 remove the valid tool call check for now 2025-06-30 18:18:58 -07:00
Dallin Romney
fa1253bae5 agent papercuts + tool message updates - cleanup 2025-06-30 17:28:02 -07:00
Dallin Romney
c69521fb95 specific file for default system messages 2025-06-30 17:14:20 -07:00