2026.06.16
### Electra AI Center — Release Notes 2026.06.16
This patch introduces a major suite of functional, event-driven, and structural bug fixes to the graphical environment (electra_gui.py) following an 8-round systematic audit. Additionally, the model directory has been expanded to support 126 models—including critical new updates like kimi-k2.7-code, gemini-3-flash-preview, deepseek-v4-pro, gpt-oss:20b, and kimi-k2-thinking.
🎛️ Refactored Subsystems & Audited Bug Fixes
- WebKit-JS Base64 UTF-8 Bridging & String Escaping
Deprecation & WebKit2GTK Crash Fix: Replaced the legacy decodeURIComponent(escape(window.atob(...))) UTF-8 base64 decoding pattern inside add_chat_message and streamdo_render [1]. On systems running modern WebKit2GTK 6.0 in strict mode, escape is undefined and threw critical ReferenceError exceptions, dropping streaming blocks [1]. Implemented a robust, native decoding pipeline:
new TextDecoder().decode(Uint8Array.from(atob(payload), c => c.charCodeAt(0)))
Apostrophe & Single-Quote Handling: The model routing names and labels containing single quotes (e.g., Electra [Writer's Mode] or model naming conventions with single quotes) would break JS string literals when compiling startStream('{sender}', ...). Added backslash and quote sanitization (.replace('\', '\\').replace("'", "\'")) on both Python and JavaScript boundaries.
System Pill Input Sanitization: Extended escaping within add_system_pill to sanitize backslashes, carriage returns (\r), and backticks (`) to prevent broken JS injections on AI file mentions.
CommonMark HTML-Escaping: Resolved a critical parsing bug where code blocks containing generic definitions (List), template strings (${var}), or logical checks (x && y) bypassed HTML-escaping before insertion. Code block text is now fully escaped to entities (&, <, >) prior to rendering.
- Text Buffers, Undo History, & In-Place Splicing
Undo Stack Preservation on AI Writes: Rewriting text via code replacements, formatting engines (Ctrl+Shift+I), bulk replaces, or LSP refactoring was utilizing buf.set_text(), completely blowing away the user's undo stack. Wrapped all buffer mutations inside begin_user_action() and end_user_action() blocks, performing clean delete() and insert() sequences to preserve the editing history.
Stale Offset Protection on Slow Edits: During inline AI rewrites (Ctrl+K), the editor now snapshots the complete buffer text at call-time. If the user continues typing during the API call (up to 60s timeout), the return block is spliced against the snapshotted baseline rather than stale character offsets, preventing out-of-order text corruption.
Keybinding Collision & Redundant Multi-Line Sends: Bare Enter (send) and Ctrl+Enter (newline) were executing identical send operations, preventing multiline messages. Bare Enter remains mapped to the send event, while Ctrl+Enter has been configured to insert newlines (\n) into the buffer.
Non-Source Context Filters: In Coder Mode, the editor now checks tab suffixes and file extensions before performing auto-context injections, preventing the engine from attempting to open and read binary image tabs or virtual preview buffers (::md_preview).
- File Tree, Polling, & Workspace Synchronization
Double-Thread Mitigation: Refactored deferredpopulate_tree. Previously, calling the method from within background thread instances (like refresh_file_tree or pollfile_tree) resulted in double-threading by spawning nested t.Thread loops. The background logic has been cleanly separated into run_tree_scan.
Workspace Generation Checking: Added a scangeneration integer tracking mechanism. Rapid save triggers or overlapping poll sequences now discard stale in-flight results, ensuring only the most up-to-date workspace tree scan populates the GtkTreeStore.
Asynchronous Directory Scans: Standardized all legacy synchronous populate_tree() calls.Scans on folder switches, session state restores, and GUI sync actions now execute on dedicated background threads, eliminating main thread UI blocking.
Background Log Quieting: Integrated a silent boolean pass to suppress "● Indexing workspace..." logs from appearing in the activity log during background tree scans.
Pruning Irrelevant Directories: Expanded the ignore paths SKIPDIRS) during recursive walks to block heavy project files: pycache, node_modules, .venv, venv, env, dist, build, .tox, .mypy_cache, and similar compilation outputs.
Recursive Folder Filtering: Fixed the file explorer search function to check both directory and child nodes. Previously, searching for a file hid unmatched parent directories, making matching children invisible.
- UI Layout, Dialogs, & Viewports
Minimap Layout Navigation: Introduced the getsource_view(pw) layout-traversal helper. When the Minimap is enabled, active tab page widgets are encapsulated inside a custom Gtk.Box layout instead of a Gtk.ScrolledWindow. The new helper safely navigates both structural types, repairing broken scroll-to-iter operations, word-wrap toggles, indent options, and search jumps on minimap-enabled tabs.
Default Context Menu Suppression: Modified the right-click mouse listener in the editor oneditor_right_click) to return True upon displaying the custom popover. This consumes the event and blocks GtkSourceView from layering its default context menu on top of the custom GUI popup.
Split Editor Layout Failures: Corrected a layout crash inside togglesplit_editor. The splitter open command was calling pack_start() on old_parent (which is a Gtk.Paned layout and lacks pack_start capabilities). Swapped to use pack1() with fallback protections.
Sidebar Restorations: Re-entering Coder Mode after a Chat session now programmatically checks the sidebar state and restores the main_paned width to sidebarexpanded_pos if it was collapsed (width < 40).
Transient Popups & Window Grabs: Added set_transient_for(self) properties to the @-mention and palette popups to prevent them from dropping behind main panels. Implemented an active Gdk pointer grab on the right-click context menu to auto-close the popup whenever a user clicks outside the interface.
Interactive Dialog Handling: Enabled set_activates_default(True) and default responses for the "New File" and "Rename" dialog prompts, allowing users to submit directory actions using the Enter key.
- Code Completion, Formatting, & Metrics
Ghost Buffer Switching Fix: If the user changed active editor tabs while the autocomplete API call was in-flight, ghostclear previously referenced the active buffer, missing the old buffer's ghost tags. The tags are now resolved dynamically via ghostanchor_mark.get_buffer(), ensuring thorough tag cleanup.
Autocomplete Accept Cooldown: Implemented a 1500ms post-accept cooldown timer ghostpost_accept_done). This prevents immediate re-triggering of completion runs caused by buffer edits made during the autocomplete insertion.
Word/Character Count Initialization: The Writer Mode metric labels are now updated upon entering the mode and opening files, preventing stale or empty strings from showing until the first keystroke.
Find-In-Project Case Matching: Linked selffipcase_btn to a new onfip_case_toggled handler, resolving a bug where toggling the "Aa" match option provided no visual active-state feedback.
☁️ New Models Added to the Fallback Matrix
This release scales the available model register to 126 entries, updating fallback chains and routing priorities across both proprietary and open ecosystems.
Total Registered Endpoints: 126 Models (Cloud + Proprietary Endpoints)
Key Additions:
- kimi-k2.7-code — Upgraded coding capabilities with specialized syntax handling.
- gemini-3-flash-preview — Low-latency, high-performance multimodal reasoning.
- deepseek-v4-pro — High-context reasoning and math-heavy programming.
- kimi-k2-thinking — Long-context search and structured logical step-by-step reasoning.
- gpt-oss:20b — Fast, lightweight general-purpose completions.
🐝 Asynchronous Agent Swarm Mode (Coder Mode)
We have introduced a multi-agent concurrency framework for Coder Mode to distribute complex software engineering tasks across parallel execution threads.
JSON Task Decomposition (Orchestrator): Entering /swarm (or clicking the 🐝 toggle in the toolbar) routing routes code requests to an orchestrator model. This initial single-pass pass analyzes the workspace and outputs a structured JSON blueprint decomposing the request into up to six discrete file-specific tasks.
Concurrent Worker Threads: The application spawns a dedicated worker thread for each task [1]. Each worker operates in complete isolation, maintaining its own:
- Dedicated chat history and context window.
- Thread-safe access to the global tool execution map (TOOLS).
8-round agentic execution loop, allowing workers to iteratively call read_file_with_lines, write_file, or run_command.
Text-Only Markdown Extraction Fallbacks: If a worker model returns plain markdown code blocks instead of structured tool calls, a fallback parser extracts the first code fence block and writes it to the designated file path.
Reviewer Pass: After all worker threads resolve, a final review agent evaluates the combined changes in a single pass to check for consistency, logical gaps, and import conflicts.
Thread-Safe Status Broadcasting: The worker threads stream status updates (🔄 active, ✅ done, ❌ error, ⏳ queued). These updates are snapshotted in Python before being pushed via GUI_STREAM_CALLBACK("swarm_update") to a GTK status panel in the chat interface.
✏️ Inline Edit Mode Overhaul (Ctrl+K)
The inline editing popover has been rewritten to resolve attribute exceptions, add missing context, and improve UI usability.
Correct API Attribute Routing: Replaced outdated references at.API_URL, at.API_KEY, etc.) with global configuration paths (CODING_API_URL, CODING_API_KEY, CODING_MODEL).
Surrounding Context Injection: The popover now reads the active cursor position or selection and injects ±30±30 lines of surrounding code into the LLM system prompt. This ensures the model understands imports, variable declarations, and enclosing classes.
Interactive Control Set: Replaced the focus-out dismissal with modal boundaries, adding explicit Apply and Cancel buttons along with a ⏳ AI is thinking... state label to lock input fields during active generation.
Indentation & Formatting Normalization: Added a regex-based parser to strip Markdown fencing tags (e.g., ```python) from the model's output [1]. The parser detects the leading whitespace indentation of the selection and adjusts the generated lines to match the surrounding source indentation.
📂 Active Open-Tab Context Injection
To improve context awareness, Coder and Writer modes now automatically inject the contents of all open editor tabs into the system prompt.
Live Buffer Extraction: On tab switch, open, or close events, the GUI calls syncopen_tabs() to read the live GtkSourceBuffer contents. This allows the AI to reference unsaved, in-memory edits.
Debounced Event Hooks: In addition to tab-lifecycle triggers, a 3-second typing debounce timer pushes live modifications to the backend via TABS_CHANGED callbacks.
- Adaptive Context Budgets: To prevent token window saturation, the system scales the injected context [1]:
- Files ≤120≤120 lines: Fully injected.
- Files >120>120 lines: First 40 lines injected with a ... N more lines — use read_file() truncation notice.
- Up to 8 open tabs are indexed (prioritizing the currently active tab).
- Terminal Diagnostics: Added the /tabs command to display active memory allocations and path stubs .
📊 Streaming Diff Preview
The diff viewer now streams modifications incrementally as tokens arrive from the model.
Early SSE Interception: The system monitors the Server-Sent Events (SSE) stream for "tool_calls" events. Because the server sends the completed tool parameters before executing the target tool, the GUI intercepts this event to capture the intended file write.
Incremental Diff Rendering: The GUI opens a streaming tab (labeled ~ filename) and renders a live, scrollable green/red hunk diff comparison of the old on-disk content versus the incoming stream.
Pending Execution States: If a tool modifies files dynamically (e.g., search_and_replace or edit_file_lines), the editor displays a loading spinner and message ("search_and_replace — editing...") before rendering the final diff once the process completes.
Interactive Approvals: Once generation concludes, the tab label updates to Δ filename, presenting a read-only diff or loading the interactive Hunk View for per-hunk Accept/Reject approvals.
🧪 Automatic Test Generation (Ctrl+Shift+G)
Added a dedicated test generation utility to the status bar, context menus, and Command Palette.
Multi-Framework Auto-Detection: The system inspects the target file extension and maps the generation request to the correct environment runner (pytest, Jest, Go test, cargo test, or RSpec).
Prompt Assembly Popover: Clicking 🧪 Tests (or pressing Ctrl+Shift+G) triggers a Gtk.Popover with options for test style (Unit, Integration, E2E) and a free-text field for extra instructions.
Dynamic Collision Warning: If the matching test file already exists, the popover warns the user that the action will regenerate and open a diff view against the existing file.
Unified Message Bus Routing: The generation request is sent through the standard backend_handler channel, allowing the process to utilize the active Coder agent loop, streaming diffs, and linting rules.
👻 Ghost Text Completion Defences
The inline auto-completion framework has been updated to prevent delayed, stale suggestions from popping up as the user continues typing.
Monotonic Sequence Counter ghostseq): Every keypress increments a sequence ID. When an completion thread starts, it captures the current sequence. Upon completion, the result is discarded if the active sequence has advanced.
Asynchronous Re-Triggering: If a completion request is in-flight and a new keystroke occurs, the system sets ghostpending = True. When the active thread finishes, it immediately triggers the next completion for the updated cursor position, avoiding extra debounce delay.
Post-Accept Cooldown: Added a 1500ms lock ghostpost_accept_done) after committing a suggestion (Tab key) to prevent the resulting buffer changes from immediately spawning a new suggestion.
⚙️ GTK Workspace File Operations Refactoring
The backend tool actions for direct file system management have been restructured to fully sync with the GTK workspace.
- delete_file Improvements:
- Auto-closes any matching open editor tabs to prevent zombie edits.
- Automatically removes the path from FILES_MODIFIED and FILE_BACKUPS.
- Resolves file deletion through safe background pathways, supporting a force parameter to bypass prompts during workspace cleanups.
- move_file Enhancements:
- Dynamically re-targets open editor tabs to the new file path.
- Remaps current FILES_MODIFIED and backup/undo states to preserve file history.
- Recursively generates any non-existent parent directory structures at the destination.
- copy_file & create_directory Updates:
- Implements dirs_exist_ok=True checks for copying directories to prevent write crashes.
- Auto-registers newly copied destination paths in the FILES_MODIFIED tracker.
Core Syncing & Schema Refactoring: All four operations now trigger refresh_tree and append entries to the activity log. The tool descriptions have been updated with explicit system guidelines detailing the advantages of using these native tools over raw shell commands (rm, mv, mkdir, cp) to ensure compatibility with active sandbox boundaries.
🔴 Synchronous Main-Thread GUI Block Fixes (electra gui)
Background Thread Offloading: Click events on Mode Tabs onmode_btn), Folder Pickers (on_open_folder_clicked), the Workspace Switcher onws_switch), and the Clear Chat dialog (on_clear_clicked) were invoking backend_handler(...) synchronously on the GTK main thread [1].
The Performance Issue: The backend enable_coding_mode() procedure performs heavy filesystem indexing countproject_files, indexproject_cached, and build_project_context), which freezes the entire GUI window for up to several seconds during every mode or workspace switch [1].
The Resolution: All three action types (MODE_CHANGE, WORKSPACE_CHANGE, and CLEAR_CHAT) now dispatch asynchronously to a dedicated daemonized worker thread, preventing main-thread GUI blocking [1]. Added a named backendmode_change_worker thread to catch and log any internal state errors cleanly [1].
🔴 3P & Offline Stream Routing Corrections (ai terminal)
- 3rd-Party GUI Streaming Pipeline
The Problem: When 3rd-party API providers (OpenAI direct, Groq, xAI, Perplexity, etc.) were active in Coder/Writer modes, 3pstream_chat only wrote chunks to standard output (sys.stdout.write) and bypassed the WebKit chat view [1]. Furthermore, the routing loop fired a terminal "end" callback without a preceding "start" event, resulting in a completely silent response inside the GUI [1].
The Fix:
Moved the GUI_STREAM_CALLBACK("start", phase=...) event to fire before initiating 3P stream routing [1].
Added a gui_callback parameter pass to 3pstream_chat() [1]. Both the Anthropic and OpenAI-compatible SSE chunk loops now dynamically pipe incoming data packets to gui_callback("chunk", chunk, False) [1].
- Ollama / Offline Mode GUI Unlocking
The Problem: The local model execution path bypassed standard WebKit stream bindings [1]. In GUI mode, this left the interface permanently locked at completion with no printed output and an unreleased focus state [1].
The Fix: Wrapped the local/Ollama response generation inside a standard start-chunk-end stream callback lifecycle, ensuring proper UI unlocking on exit [1].
🔒 Compactor Token Validation & Thread-Safe Guards (ai terminal)
- Session Compaction Schema Failures (Critical)
The Problem: During auto-compaction routines autocompact_session and autocompact_command_session), raw message lists containing "tool" or "tool_calls" roles were forwarded directly to chat completion endpoints without their matching tools schemas [1]. This triggered silent HTTP 400 Bad Request exceptions on upstream servers [1]. Because raise_for_status() was absent, the handler returned a blank string, wiping out all AI session context [1].
The Fix:
Filtered history payloads to system/user/assistant roles [1].
Flattened complex list-type message contents, enforced a max_tokens: 1024 cap, and added an explicit raise_for_status() validator to capture future network failures [1].
- Dry-Run Thread Deadlocks (Critical)
The Problem: Running shell operations through run_command while in DRY_RUN_MODE invoked a bare terminal-only input() prompt [1]. In GUI mode, this permanently deadlocked the background worker thread [1].
The Solution: Intercepted the prompt and routed the query through GUI_CONFIRM_CALLBACK when running in GUI_MODE, reserving CLI input() only for terminal sessions [1].
💿 ISO Agent Import-Time Permission Fix (iso agent v2)
The Problem: A 4-line testing script was left at module scope inside iso_agent.py:
codePython
with open('/tmp/iso_part1.py', 'a') as f: import inspect pass print("part1 appended OK")
Because this executed at import time, any permission restriction on the /tmp/iso_part1.py file path (such as files created by a previous root execution) raised [Errno 13] Permission denied [1]. This caused the entire module import to fail when a user confirmed a build, crashing the terminal session before any function was invoked [1].
The Fix: Removed the module-level test lines, resolving the permission crash [1].
⚡ Additional Subsystem & Tool Refactorings
- Dynamic Host OS Diagnostics
The system prompt previously instructed the AI "OS: Unknown, you need to detect the OS", forcing models to waste their first agentic turn running discovery commands like uname [1].
The system now queries host parameters once on startup (via /etc/os-release, uname -r, uname -m) and injects them directly into the system prompt (e.g., "OS: MakuluLinux 2025 kernel 6.8.0-51-generic x86_64") [1].
- LSP Numeric Line Exception Handling
The four language server tools (lsp_goto_definition, lsp_find_references, lsp_rename_symbol, lsp_hover) cast line parameters using int(args.get("line", 1)) [1]. If models passed a non-numeric string or None, this raised unhandled casting exceptions that crashed the loop [1].
Wrapped all four casts in try/except (TypeError, ValueError) with fallbacks [1].
- Comprehensive Diff Preview Finalization
Added streaming_diff_done triggers to search_and_replace, edit_file_lines, and search_and_replace_batch [1]. This allows diff panels to resolve out of "pending" states immediately upon tool completion [1].
Integrated full workspace tree updates, file-open actions, and activity log tracking for patch_file operations [1].
- Double-Refreshes & Handoff Tracking
Idempotency Guard: Added a selfisai_working state check to backenddone inside electra_gui.py to prevent duplicate file tree refreshes and focus grabs on recovery paths [1].
Handoff Age Calculation: Cleaned up a double syscall in hfage_days checks, replacing the logical and statement with a clean variable assignment [1].
Status of Road map - Updated :
We have successfully completed Phase 3 on the road-map, We are now virtually on par with ALL other top coder apps out there, Here is a realistic Road-map of where we are ahead and where we are behind and what is still to come in the following weeks.