Skip to content

Performance async image read 10974862260397376706 - #1486

Open
0m364 wants to merge 36 commits into
sigoden:mainfrom
0m364:performance-async-image-read-10974862260397376706
Open

Performance async image read 10974862260397376706#1486
0m364 wants to merge 36 commits into
sigoden:mainfrom
0m364:performance-async-image-read-10974862260397376706

Conversation

@0m364

@0m364 0m364 commented Mar 5, 2026

Copy link
Copy Markdown

No description provided.

0m364 and others added 30 commits June 18, 2023 13:20
Instructions for unrooted android via termux
👀
corrected mistypes added termux-api (not needed for aichat for some reason but it does seem to make it faster) and added --locked install option as I ran into an issue on proot-distro of alpine .. fixed with --locked
makes a local API to use with a rust based llm (hopefully.. not tested yet)
- Add `pre_command` and `post_command` to global config to allow running scripts before/after chat completion.
- Add `agents/android` with Termux tool definitions and wrapper scripts.
- Add `create_tool` script to allow agentic tool creation.
- Add `roles/jules.md` persona.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
Embeds a set of native developer tools directly into aichat to enhance its agent capabilities without relying on external scripts. This includes:
- `fs_cat`: Read file contents.
- `fs_ls`: List directory contents.
- `fs_mkdir`: Create directories.
- `fs_write`: Write file contents.
- `fs_search`: Recursive substring search in files.
- `command_run`: Execute shell commands.

These tools are automatically registered and available for function calling, similar to OpenCode and Goose agents.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
Embed Agentic Toolkit (OpenCode/Goose style)
- Added `src/client/jules.rs` implementing JulesClient (OpenAI-compatible/Gemini-like API).
- Registered `jules` in `src/client/mod.rs`.
- Updated `src/config/mod.rs` to automatically enable all built-in tools (fs_*, command_run) for the `jules` client, making it "full powered" by default.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
- Removed blocking `std::thread::sleep` from `Spinner::set_message`.
- Converted `Spinner::stop` to an `async` function and replaced `std::thread::sleep` with `tokio::time::sleep`.
- Updated all call sites of `spinner.stop()` in `src/render/stream.rs` to `.await` the new async function.

These changes prevent worker thread starvation in the tokio executor, especially during RAG synchronization and message streaming.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
Using `unwrap()` on `partial_cmp` is unsafe because floating point numbers
can be NaN, which `partial_cmp` returns as `None`. This can cause a panic.
This change replaces it with `total_cmp`, which provides a total ordering
for f32 and safely handles NaN.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
Implemented a comprehensive suite of tests for the `strip_think_tag` function in `src/utils/mod.rs`.
The tests cover:
- Basic tag removal at the start of the string.
- Handling of leading and trailing whitespace around the tag.
- Multiline tags and content.
- Strings without any tags.
- Ensuring tags not at the start are preserved.
- Verifying that only the first anchored tag is removed.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
This commit fixes a security vulnerability where filenames starting with a dash ('-')
could be interpreted as command-line options when substituted into a loader command.

Changes:
- Added `sanitize_path` to prepend `./` to relative paths starting with '-'.
- Refactored `run_loader_command` to use a more robust placeholder replacement
  logic that prevents double-expansion vulnerabilities.
- Added unit tests for path sanitization and placeholder replacement.
- Extracted logic into separate functions for better testability.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
…5988954876939

🔒 fix: argument injection via filename in loader command
…96288677195082

🧪 Add unit tests for `strip_think_tag`
…6243707556956

🧹 replace unsafe unwrap() on partial_cmp with total_cmp
…1211793

Add Google Labs Jules client with full powered tools
…47469

⚡ Optimize Spinner by removing blocking sleeps in async context
…event XSS

- Introduce DOMPurify to sanitize HTML generated from Markdown.
- Implement event delegation for 'Copy code' buttons to maintain functionality after sanitization.
- Sanitize error messages to prevent reflected XSS.
- Apply fixes to both assets/playground.html and assets/arena.html.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
google-labs-jules Bot and others added 6 commits February 25, 2026 11:51
Added a comprehensive test suite for `estimate_token_length` in `src/utils/mod.rs` covering:
- Empty strings
- Single and multiple ASCII words
- Non-ASCII (CJK) characters
- Mixed content and punctuation handling

This increases the reliability and coverage of the token length estimation utility.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
This commit optimizes the performance of the web crawler by avoiding redundant
parsing of CSS selectors.

1. Added a static LINK_SELECTOR using LazyLock for the common "a" tag selector.
2. Updated CrawlOptions to include a cached extract_selector (Arc<Selector>).
3. Added a prepare() method to CrawlOptions to pre-parse the extraction selector
   once per crawl.
4. Updated crawl_website to call options.prepare() and crawl_page to use the
   pre-parsed selectors.

These changes significantly reduce CPU overhead and allocations during website
crawling, especially for large sites with many pages.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
…398699382699

🧪 Add unit tests for estimate_token_length utility
…9400824048618

⚡ [performance] Cache CSS selector parsing
…98204911

🔒 [security fix] Fix XSS in Playground and Arena via Markdown Rendering
Convert `read_media_to_data_url` to an asynchronous function using `tokio::fs::read` to avoid blocking the Tokio worker threads in `load_documents`. This improves the overall efficiency and responsiveness of the application by yielding the thread back to the runtime during disk I/O.

Co-authored-by: 0m364 <13804150+0m364@users.noreply.github.com>
ei-grad added a commit to ei-grad/aichat that referenced this pull request Jul 11, 2026
Add an explicit --files list grammar for shell-expanded inputs while
preserving the established single and repeated -f behavior. This avoids
classifying positional prompt tokens by filesystem existence and makes the
file/prompt boundary explicit.

Apply command preludes before --info with defined REPL fallback semantics,
parse editor commands into an executable plus arguments without invoking a
shell, and reuse that parser for REPL buffer editing. Move local image reads
to Tokio, use the configured warning color for generated shell commands, and
document installation and local-agent layouts.

Adapt the bounded fixes discussed in:
sigoden#1451
sigoden#1509
sigoden#1534
sigoden#1533
sigoden#1512
sigoden#1525
sigoden#1383
sigoden#1437
sigoden#1486

Co-Authored-By: Codex CLI <noreply@openai.com>
ei-grad added a commit to ei-grad/aichat that referenced this pull request Jul 11, 2026
Salvage only the async media-read intent from sigoden#1486 without importing its
polluted ancestry. Enable Tokio filesystem support, await local image reads,
separate byte-to-data-URL conversion for deterministic tests, and include the
source path in unsupported-type and read failures.

Source PR: sigoden#1486
Source commit: sigoden@0cfa32f
Reviewed behavior: 542f02a

Co-Authored-By: Codex CLI <noreply@openai.com>
ei-grad added a commit to ei-grad/aichat that referenced this pull request Jul 11, 2026
Integrate the narrow Tokio filesystem branch without importing upstream
PR sigoden#1486 or its unrelated history. The second parent records only the media
read, error-context, helper, test, and Cargo feature delta.

Source: sigoden#1486
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.

1 participant