Skip to content

Add image attachment support to chat#6

Merged
PureWeen merged 1 commit intomainfrom
dev/kubaflo/images-support
Feb 8, 2026
Merged

Add image attachment support to chat#6
PureWeen merged 1 commit intomainfrom
dev/kubaflo/images-support

Conversation

@kubaflo
Copy link
Copy Markdown
Collaborator

@kubaflo kubaflo commented Feb 8, 2026

Enable inline image attachments via drag-and-drop, paste, and file picker. UI changes (Home.razor / Home.razor.css) add an attachment strip, attach button, drag-over styling, and file input handling; pending images are shown and can be removed. Message sending now allows sending when images are attached and prepends attached file paths to the prompt. ChatMessageList.razor now detects user-specified local image paths and inlines them as data URIs when available; styles for inline attachments added to ChatMessageList.razor.css. index.html adds JS interop helpers (setupImageDropZone, readFileAsBase64, triggerImageFilePicker, readSelectedFiles) to read images and call OnImageDropped. Images are saved to a temporary AppData directory and cleaned up when removed. Small defensive/fallback handling added for various file-read scenarios.

Screen.Recording.2026-02-08.at.01.00.27.mov

Enable inline image attachments via drag-and-drop, paste, and file picker. UI changes (Home.razor / Home.razor.css) add an attachment strip, attach button, drag-over styling, and file input handling; pending images are shown and can be removed. Message sending now allows sending when images are attached and prepends attached file paths to the prompt. ChatMessageList.razor now detects user-specified local image paths and inlines them as data URIs when available; styles for inline attachments added to ChatMessageList.razor.css. index.html adds JS interop helpers (setupImageDropZone, readFileAsBase64, triggerImageFilePicker, readSelectedFiles) to read images and call OnImageDropped. Images are saved to a temporary AppData directory and cleaned up when removed. Small defensive/fallback handling added for various file-read scenarios.
@PureWeen PureWeen merged commit d22589b into main Feb 8, 2026
PureWeen added a commit that referenced this pull request Feb 20, 2026
Concurrency fixes:
- Swap _sessions before wiring event handler on reconnect (#2)
- Block ALL events from orphaned handlers, not just terminal (#3)
- Add lock(_imageQueueLock) to all image queue mutations (#4)
  including dequeue, reinsert, ClearQueue, rename, close, dispose
- Clear IsResumed on error and watchdog paths (#5)
- Add RunContinuationsAsynchronously to remaining TCS (#6)

Architecture/contract fixes:
- Add [JsonIgnore] to ShouldWarnOnStall, LastSimilarity (#7)
- Fix ConsecutiveErrors increment-before-check ordering (#8)
- Set IsCancelled on all non-success termination paths (#10)
  including stall, error-stall, max-iteration, OperationCanceled,
  empty-assignment error stall, and single-agent StopReflectionCycle
- Add session dir deletion for ghost evaluator pruning (#12)
- Add CompletedAt to StopReflectionCycle (#12 related)

Already correct (no changes needed):
- #9: CurrentIteration == 1 check was already fixed
- #11: Comments already reference string-based stall detection

Documentation:
- Update stall detection from 'hash match' to 'string equality'
- Update error handling to show ConsecutiveErrors (not ConsecutiveStalls)
- Add IsCancelled invariant to exit conditions table
- Add 5 new invariants: orphan gate, reconnect ordering,
  image queue locking, IsResumed clearing, TCS creation
- Document empty-assignment retry behavior

817/817 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@PureWeen PureWeen deleted the dev/kubaflo/images-support branch February 22, 2026 00:19
PureWeen added a commit that referenced this pull request Apr 5, 2026
…-hunk gaps

- #1 (CRITICAL): Snapshot CM instance IDs before clearing dictionaries in
  OnParametersSet, preventing InvalidOperationException from enumerator
  invalidation and ensuring all JS instances are properly disposed
- #2 (CRITICAL): Add generation counter to InitCodeMirrorForFile; stale
  completions (from a previous diff) are detected and disposed immediately
- #3: Double-init guard — skip InitCodeMirrorForFile if _cmInstances
  already contains an entry for the fileIdx
- #4: DisposeCmInstance replaced with snapshot-then-remove pattern;
  _pendingEditorInit cleared on Table toggle to prevent stale inits
- #5: ReconstructOriginal/Modified now insert blank placeholder lines
  for inter-hunk gaps to preserve correct line numbering in CM MergeView
- #6: Add SRI integrity hash (sha384) to codemirror-bundle.js script tag
- #7: Replace O(n²) Files.IndexOf(file) with indexed for loop
- #8: All catch blocks now log to Console.Error with [DiffView] prefix
- NEW-1: Post-loop Clear() race eliminated — DisposeJsInstancesByIdAsync
  works on snapshotted arrays, never touches _cmInstances dictionary
- Added _disposed guard to DisposeAsync for safe double-dispose

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 5, 2026
…-hunk gaps

- #1 (CRITICAL): Snapshot CM instance IDs before clearing dictionaries in
  OnParametersSet, preventing InvalidOperationException from enumerator
  invalidation and ensuring all JS instances are properly disposed
- #2 (CRITICAL): Add generation counter to InitCodeMirrorForFile; stale
  completions (from a previous diff) are detected and disposed immediately
- #3: Double-init guard — skip InitCodeMirrorForFile if _cmInstances
  already contains an entry for the fileIdx
- #4: DisposeCmInstance replaced with snapshot-then-remove pattern;
  _pendingEditorInit cleared on Table toggle to prevent stale inits
- #5: ReconstructOriginal/Modified now insert blank placeholder lines
  for inter-hunk gaps to preserve correct line numbering in CM MergeView
- #6: Add SRI integrity hash (sha384) to codemirror-bundle.js script tag
- #7: Replace O(n²) Files.IndexOf(file) with indexed for loop
- #8: All catch blocks now log to Console.Error with [DiffView] prefix
- NEW-1: Post-loop Clear() race eliminated — DisposeJsInstancesByIdAsync
  works on snapshotted arrays, never touches _cmInstances dictionary
- Added _disposed guard to DisposeAsync for safe double-dispose

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 6, 2026
…-hunk gaps

- #1 (CRITICAL): Snapshot CM instance IDs before clearing dictionaries in
  OnParametersSet, preventing InvalidOperationException from enumerator
  invalidation and ensuring all JS instances are properly disposed
- #2 (CRITICAL): Add generation counter to InitCodeMirrorForFile; stale
  completions (from a previous diff) are detected and disposed immediately
- #3: Double-init guard — skip InitCodeMirrorForFile if _cmInstances
  already contains an entry for the fileIdx
- #4: DisposeCmInstance replaced with snapshot-then-remove pattern;
  _pendingEditorInit cleared on Table toggle to prevent stale inits
- #5: ReconstructOriginal/Modified now insert blank placeholder lines
  for inter-hunk gaps to preserve correct line numbering in CM MergeView
- #6: Add SRI integrity hash (sha384) to codemirror-bundle.js script tag
- #7: Replace O(n²) Files.IndexOf(file) with indexed for loop
- #8: All catch blocks now log to Console.Error with [DiffView] prefix
- NEW-1: Post-loop Clear() race eliminated — DisposeJsInstancesByIdAsync
  works on snapshotted arrays, never touches _cmInstances dictionary
- Added _disposed guard to DisposeAsync for safe double-dispose

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 6, 2026
…-hunk gaps

- #1 (CRITICAL): Snapshot CM instance IDs before clearing dictionaries in
  OnParametersSet, preventing InvalidOperationException from enumerator
  invalidation and ensuring all JS instances are properly disposed
- #2 (CRITICAL): Add generation counter to InitCodeMirrorForFile; stale
  completions (from a previous diff) are detected and disposed immediately
- #3: Double-init guard — skip InitCodeMirrorForFile if _cmInstances
  already contains an entry for the fileIdx
- #4: DisposeCmInstance replaced with snapshot-then-remove pattern;
  _pendingEditorInit cleared on Table toggle to prevent stale inits
- #5: ReconstructOriginal/Modified now insert blank placeholder lines
  for inter-hunk gaps to preserve correct line numbering in CM MergeView
- #6: Add SRI integrity hash (sha384) to codemirror-bundle.js script tag
- #7: Replace O(n²) Files.IndexOf(file) with indexed for loop
- #8: All catch blocks now log to Console.Error with [DiffView] prefix
- NEW-1: Post-loop Clear() race eliminated — DisposeJsInstancesByIdAsync
  works on snapshotted arrays, never touches _cmInstances dictionary
- Added _disposed guard to DisposeAsync for safe double-dispose

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 7, 2026
…-hunk gaps

- #1 (CRITICAL): Snapshot CM instance IDs before clearing dictionaries in
  OnParametersSet, preventing InvalidOperationException from enumerator
  invalidation and ensuring all JS instances are properly disposed
- #2 (CRITICAL): Add generation counter to InitCodeMirrorForFile; stale
  completions (from a previous diff) are detected and disposed immediately
- #3: Double-init guard — skip InitCodeMirrorForFile if _cmInstances
  already contains an entry for the fileIdx
- #4: DisposeCmInstance replaced with snapshot-then-remove pattern;
  _pendingEditorInit cleared on Table toggle to prevent stale inits
- #5: ReconstructOriginal/Modified now insert blank placeholder lines
  for inter-hunk gaps to preserve correct line numbering in CM MergeView
- #6: Add SRI integrity hash (sha384) to codemirror-bundle.js script tag
- #7: Replace O(n²) Files.IndexOf(file) with indexed for loop
- #8: All catch blocks now log to Console.Error with [DiffView] prefix
- NEW-1: Post-loop Clear() race eliminated — DisposeJsInstancesByIdAsync
  works on snapshotted arrays, never touches _cmInstances dictionary
- Added _disposed guard to DisposeAsync for safe double-dispose

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 7, 2026
…-hunk gaps

- #1 (CRITICAL): Snapshot CM instance IDs before clearing dictionaries in
  OnParametersSet, preventing InvalidOperationException from enumerator
  invalidation and ensuring all JS instances are properly disposed
- #2 (CRITICAL): Add generation counter to InitCodeMirrorForFile; stale
  completions (from a previous diff) are detected and disposed immediately
- #3: Double-init guard — skip InitCodeMirrorForFile if _cmInstances
  already contains an entry for the fileIdx
- #4: DisposeCmInstance replaced with snapshot-then-remove pattern;
  _pendingEditorInit cleared on Table toggle to prevent stale inits
- #5: ReconstructOriginal/Modified now insert blank placeholder lines
  for inter-hunk gaps to preserve correct line numbering in CM MergeView
- #6: Add SRI integrity hash (sha384) to codemirror-bundle.js script tag
- #7: Replace O(n²) Files.IndexOf(file) with indexed for loop
- #8: All catch blocks now log to Console.Error with [DiffView] prefix
- NEW-1: Post-loop Clear() race eliminated — DisposeJsInstancesByIdAsync
  works on snapshotted arrays, never touches _cmInstances dictionary
- Added _disposed guard to DisposeAsync for safe double-dispose

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 14, 2026
…-hunk gaps

- #1 (CRITICAL): Snapshot CM instance IDs before clearing dictionaries in
  OnParametersSet, preventing InvalidOperationException from enumerator
  invalidation and ensuring all JS instances are properly disposed
- #2 (CRITICAL): Add generation counter to InitCodeMirrorForFile; stale
  completions (from a previous diff) are detected and disposed immediately
- #3: Double-init guard — skip InitCodeMirrorForFile if _cmInstances
  already contains an entry for the fileIdx
- #4: DisposeCmInstance replaced with snapshot-then-remove pattern;
  _pendingEditorInit cleared on Table toggle to prevent stale inits
- #5: ReconstructOriginal/Modified now insert blank placeholder lines
  for inter-hunk gaps to preserve correct line numbering in CM MergeView
- #6: Add SRI integrity hash (sha384) to codemirror-bundle.js script tag
- #7: Replace O(n²) Files.IndexOf(file) with indexed for loop
- #8: All catch blocks now log to Console.Error with [DiffView] prefix
- NEW-1: Post-loop Clear() race eliminated — DisposeJsInstancesByIdAsync
  works on snapshotted arrays, never touches _cmInstances dictionary
- Added _disposed guard to DisposeAsync for safe double-dispose

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 17, 2026
1. TCS coupling (#2): complete old TCS with partial response via TrySetResult instead of TrySetCanceled, so orchestrator workers collect content gracefully instead of hitting the exception retry path
2. Race window (#4): set IsProcessing/IsResumed/ProcessingPhase on siblingState BEFORE handler registration (safe because state isn't published to _sessions yet), eliminating the ~16ms InvokeOnUI scheduling window
3. Behavioral test (#6): added SiblingReconnect_PreservesProcessingState_OnNewState
4. SessionStabilityTests: fixed comment-matching false positive in TryUpdate ordering assertion

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Apr 19, 2026
CRITICAL fixes:
- #1 Test isolation: add [Collection("BaseDir")], restore dir in finally
  blocks, register in TestSetup.Initialize()
- #2 Stale state: only set _analyzerSessionName AFTER CreateSessionAsync
  succeeds, clear on failure
- #3 Prompt injection: remove autonomous PR-creation instructions, change
  to report-only mode ("Do NOT autonomously create branches or PRs")

MODERATE fixes:
- #4 Lifecycle: implement IAsyncDisposable, add StopAsync() that awaits
  _analysisLoop with 5s timeout, nulls _analyzerSessionName
- #5 (Feature activation deferred to UI integration PR)
- #6 Model slug: fix "claude-sonnet-4-5" → "claude-sonnet-4.5"
- #7 Timeout: wrap SendPromptAsync in 10-minute linked CancellationToken
- #8 Interval validation: clamp to Math.Max(1, value) in settings setter
  and in StartAsync
- #9 TailFile: use Queue<string> ring buffer instead of List, cap file
  read to MaxLogFileSizeBytes (10 MB)

OTHER fixes:
- #10 Remove TestHelpers class, use private CreateService() method
- Thread safety: use Interlocked for AnalysisCount and LastAnalysisAt
- Torn reads: snapshot GetAllSessions() with .ToList()
- 14 tests (up from 8): new tests for TailFile, interval clamping,
  DisposeAsync, RunSingleAnalysis null guard, report-only prompt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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