Commit graph

41 commits

Author SHA1 Message Date
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
a082de9911 Update StepContainer.tsx 2025-07-14 16:53:36 -07:00
Patrick Erichsen
1d3842653f fix response actions 2025-07-14 16:16:29 -07:00
Patrick Erichsen
3a6f928b3a Update StepContainer.tsx 2025-07-14 14:18:32 -07:00
Patrick Erichsen
5d05636891 Update StepContainer.tsx 2025-07-13 23:06:38 -07:00
Patrick Erichsen
326440f656 cleanup group header 2025-07-10 22:18:28 -07:00
Patrick Erichsen
e100d9f8ad improve tool group ui 2025-07-10 16:59:04 -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
b13f1aadcf feat: only show btn if last history item 2025-07-02 21:01:37 -07:00
Patrick Erichsen
b0492ddfee feat: more moving around 2025-04-14 10:49:10 -07:00
Patrick Erichsen
58d9eb7a7e feat: consolidate StepContainer 2025-04-11 17:42:55 -07:00
Nate
ee139138d1 persist block settings toolbar expanded and adjust padding to match lump width 2025-03-23 00:11:49 -07:00
ferenci84
7a7b29f0bd update hideActionSpace condition to include "thinking" role 2025-03-10 13:50:55 +01:00
German Swan
dae89dea1b 3832: DeepSeek-R1 reasoning display can be toggled 2025-01-24 22:31:26 +02:00
Dallin Romney
d51d46bbde open ai support and tool bug fixes 2025-01-11 08:59:32 -08:00
Nate
114b7f1bf6 Merge branch 'main' into nate/fixees 2024-12-18 22:32:35 -08:00
Nate
18c74307a8 don't display "Continue generation" for empty output 2024-12-18 21:03:35 -08:00
Dallin Romney
5cff822974 don't show while gathering context 2024-12-18 10:57:39 -08:00
Dallin Romney
98296ff125 thinking indicator 2024-12-18 10:36:50 -08:00
Test
b848d1a286 chore: rename "messages" back to "history" 2024-12-01 17:06:24 -06:00
Test
e952061fb7 Merge branch 'main' into pe/redux-updates 2024-11-30 12:56:39 -06:00
Test
009e578416 fix: merge bugs 2024-11-29 15:07:52 -06:00
Test
de853a9e32 Merge branch 'main' into pe/redux-updates 2024-11-29 12:26:35 -06:00
Test
4efd661375 feat: bugfixes on redux schema updates 2024-11-29 11:42:22 -06:00
Nate
199617aaaa Merge branch 'main' into nate/tool-use 2024-11-28 21:44:46 -08:00
Test
438cba4501 feat: update redux store schemas 2024-11-27 16:45:20 -06:00
Nate
12fba164ae update action buttons 2024-11-27 14:04:44 -08:00
Nate
6ff5279b02 WIP 2024-11-24 17:59:31 -08:00
Nate
3c42902266 ui improvement 2024-11-22 08:04:57 -08:00
Nate
98db7d3fc8 tool use ui improvements 2024-11-21 23:07:01 -08:00
Test
cf25bb210f Merge branch 'main' into nate/tool-use 2024-11-21 21:36:36 -08:00
Nate
ee7bea7c19 renderChatMessage, return ContextItem[] from tools, and other refactoring 2024-11-21 18:31:50 -08:00
Test
b4d364f761 WIP: comment out checkpoint logic 2024-11-20 17:38:29 -08:00
Test
0ac11c5398 WIP: rename MFE -> Edit 2024-11-20 14:51:38 -08:00
Nate
ba4598d25b padding stuff 2024-11-19 14:04:55 -08:00
Nate
54e25d6d88 update anthropic tool use 2024-11-19 13:32:54 -08:00
Test
f76c69dfda chore: merge main 2024-11-18 12:23:43 -08:00
Test
067da11573 adjust styling on small breakpoints 2024-11-15 14:32:13 -08:00
Test
121be85a69 feat: redo action 2024-11-13 17:22:21 -08:00
Test
5a32062610 checkpoints working with undo 2024-11-13 09:20:59 -08:00