Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR prepares the release for version 1.2.2-alpha with version update and code style fixes:

  • Updated version in Solution.props
  • Updated changelog with closed-solved issues
  • Updated README badges

marc-romu and others added 30 commits December 22, 2025 20:56
Throttle streaming DOM upserts more aggressively and process DOM updates in smaller batches to keep the UI responsive while moving/resizing the WebChat dialog.
Move chat message HTML/markdown rendering off the UI thread (including tool result ordering inserts) and ensure only the latest render per DOM key is applied.
…ug logging

- Add keyed DOM update queue (`_keyedDomUpdateLatest` + `_keyedDomUpdateQueue`) to ensure only latest render per DOM key is applied, preventing redundant updates during streaming
- Wrap all `Debug.WriteLine` calls in `[Conditional("DEBUG")]` `DebugLog` method to eliminate debug overhead in release builds
- Move HTML equality checks inside `#if DEBUG` blocks to skip expensive string comparisons in production
…fing, and wipe-in animations

- Add template cache (`_templateCache`) and LRU HTML cache (`_htmlLru`) to avoid redundant DOM parsing and equality checks during streaming
- Implement queued DOM operations (`enqueueDomOp` + `flushDomOps`) batched via `requestAnimationFrame` to reduce layout thrashing
- Add sampled equality diffing (25% sample rate) via `shouldSkipBecauseSame` to skip redundant renders when HTML unchanged
…reservation

- Remove unused `stream-update` CSS animations and `addStreamUpdateAnimation` JS function
- Remove unused `MAX_CONCURRENT_SCRIPTS` and `_activeScripts` variables from chat-script.js
- Add `FlushPendingTextStateForTurn` to ensure throttled text deltas are rendered before tool calls appear in the UI
- Fix `ConversationSession` to preserve `ContextFilter` when rebuilding AIBody in special turns and helper methods
… improve token efficiency

- Add new `instruction_get` tool that returns detailed operational instructions on-demand for canvas operations, component discovery, scripting workflows, and knowledge base usage
- Refactor `CanvasButton` system prompt to be concise and delegate detailed tool usage guidelines to `instruction_get` calls
- Remove verbose inline documentation for tool workflows (canvas state reading, component discovery, scripting, knowledge base)
…meter validation

- Enhance `instruction_get` tool description to explicitly mention required `topic` argument since some models (MistralAI, OpenAI) don't always respect JSON Schema `required` fields but do follow description text
- Add explicit validation for missing/empty required parameters in `ToolJsonSchemaValidator` with actionable error messages prompting retry
- Remove redundant null check in `instruction_get` tool body
…adapter discovery

- Extract duplicated streaming delta processing (~80 lines) into shared `ProcessStreamingDeltasAsync` helper in `ConversationSession`
- Add `GetStreamingAdapter()` to `IAIProvider` interface with caching in `AIProvider` base class, replacing reflection-based discovery
- Add `CreateStreamingAdapter()` virtual method for providers to override; update OpenAI, DeepSeek, MistralAI, Anthropic, and OpenRouter
- Removed "Clear" button from webchat and replaced with a "Regen" button on debug
## Description
 
This PR improves WebChat stability and streaming performance through
several optimizations:
 
- **Streaming Infrastructure**: Extracted shared streaming logic into
`ProcessStreamingDeltasAsync` helper method and optimized provider
adapter discovery with caching instead of reflection
- **Performance Optimizations**: Implemented template caching, LRU
diffing, keyed queue processing, and wipe-in animations for faster
message rendering
- **UI Stability**: Reduced WebChat freezes during streaming and
drag/resize operations through aggressive DOM throttling and batched
updates
- **Tool Improvements**: Added `instruction_get` tool to reduce system
prompt size and improved its reliability with explicit parameter
validation

Mitigates #261.

## Breaking Changes
 
No breaking changes.
 
## Testing Done
 
- Verified WebChat streaming performance improvements during long AI
responses
- Tested drag/resize operations during active streaming to confirm UI
stability
- Validated `instruction_get` tool functionality across different AI
providers
- Confirmed selection context providers work correctly with the new
fallback logic

## Checklist

- [x] This PR is focused on a single feature or bug fix
- [x] Version in Solution.props was updated, if necessary, and follows
semantic versioning
- [x] CHANGELOG.md has been updated
- [x] PR title follows [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) format
- [x] PR description follows [Pull Request Description
Template](#pull-request-description-template)
…component messages

- Replace "Done :)" completion messages with empty strings in AIListEvaluate, AIListFilter, AITextEvaluate, AITextGenerate, and AITextListGenerate components
- Update AsyncComponentBase to only set component message when worker output message is non-empty, preventing accidental message clearing
…utput processing

- Add early return in post-solve phase when tasks are still running (_setData == 0) or state is not ready (_state <= 0)
- Skip output processing until continuation properly sets _state and _setData
- Add debug logging to track skipped post-solve executions
- Add BoundsSerializer for panel size serialization using format "bounds:width,height"
- Serialize/deserialize panel background color in componentState.additionalProperties.color using Color serializer
- Serialize/deserialize panel size in componentState.additionalProperties.bounds while preserving position in pivot
- Register BoundsSerializer in DataTypeRegistry
- Update GhJSON documentation to reflect panel color and bounds properties
…event stale callbacks

- Add early return when debounceTimeMs is 0, indicating timer has been cancelled/reset
- Capture debounceTimeMs along with generation and target state in initial lock
- Add double-check validation using captured time value to prevent race conditions
- Update debug messages to include time value for better diagnostics
- Replace integer literals with double literals in test calculations for type consistency
- Mark ComponentStateManager field as readonly in tests
- Rename 'run' variable to 'runInput' to avoid shadowing instance field
- Simplify conditional expressions using ternary operators in InputChanged methods
- Flatten nested if statements in DeepSeekProvider reasoning_content removal logic
…teManager (#364)

## Description

Harden stateful component base behaviors to improve
stability/reliability across Grasshopper components.
 
## Breaking Changes

Saved files with components from previous version would require to run
again or to replace the component.

## Testing Done

All cases tested.

## Checklist

- [x] This PR is focused on a single feature or bug fix
- [x] Version in Solution.props was updated, if necessary, and follows
semantic versioning
- [x] CHANGELOG.md has been updated
- [x] PR title follows [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) format
- [x] PR description follows [Pull Request Description
Template](#pull-request-description-template)
This PR updates the development version date in Solution.props to
reflect the latest changes.

This is an automated PR created by the Update Development Version Date
workflow.
… fixes (#366)

This PR prepares the release for version 1.2.2-alpha with version update
and code style fixes:

- Updated version in Solution.props
- Updated changelog with closed-solved issues
- Updated README badges
@github-actions github-actions bot requested a review from marc-romu as a code owner December 27, 2025 15:34
@marc-romu marc-romu merged commit fcc55c8 into main Dec 27, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants