-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(security): update security contact email to codewhale.com #3377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d7b2983
1624c07
cd71a51
305b9e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The optional `fuzz` parameter was required to attempt the leading-indentation fuzzy fallback when exact search found zero matches. This forced the model to make two calls on every edit that needed fuzzy matching (first without fuzz -> error -> second with fuzz: true), causing a round-trip delay. | ||
|
|
||
| Fix: remove the `fuzz` gate from the count == 0 branch. The tool now automatically retries with indentation-tolerant fuzzy matching when exact search produces no results. The `fuzz` parameter is kept in the schema for backward compatibility but marked deprecated. | ||
|
|
||
| Changes: | ||
| - crates/tui/src/tools/file.rs: `if count == 0 && fuzz` -> `if count == 0` (always retry fuzzy fallback) | ||
| - crates/tui/src/tools/file.rs: removed dead `else if count == 0 { error }` branch | ||
| - crates/tui/src/tools/file.rs: updated description to note automatic fuzzy fallback | ||
| - crates/tui/src/tools/file.rs: marked fuzz parameter as deprecated in schema | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||
| import re | ||||||
|
|
||||||
| file_path = r'C:\project\F_project1\CodeWhale\crates\tui\src\core\engine.rs' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script uses a hardcoded absolute Windows path (C:\project\F_project1...), which makes it non-portable and will fail on other environments (including CI and other developers' machines). Additionally, this file seems to be a temporary script that was committed by accident. If it is needed, please use a relative path from the repository root to ensure portability.
Suggested change
|
||||||
| with open(file_path, 'r', encoding='utf-8') as f: | ||||||
| content = f.read() | ||||||
|
|
||||||
| # 1. Add helper function after runtime_prompt_text | ||||||
| marker = ' </runtime_prompt>"\n )\n}\n\n/// Spawn the engine' | ||||||
| helper_fn = ''' </runtime_prompt>" | ||||||
| ) | ||||||
| } | ||||||
|
|
||||||
| /// Check if a user message contains real user input (not just runtime metadata). | ||||||
| /// Returns true if the message has actual user text content beyond internal tags. | ||||||
| fn has_real_user_content(text: &str) -> bool { | ||||||
| // Strip known internal tags and check if meaningful content remains | ||||||
| let stripped = text | ||||||
| .replace("<turn_meta>", "") | ||||||
| .replace("</turn_meta>", "") | ||||||
| .replace("<runtime_prompt", "") | ||||||
| .replace("</runtime_prompt>", "") | ||||||
| .replace("<codewhale:runtime_event", "") | ||||||
| .replace("</codewhale:runtime_event>", ""); | ||||||
|
|
||||||
| // Check if there's non-whitespace content after stripping tags | ||||||
| let trimmed = stripped.trim(); | ||||||
| !trimmed.is_empty() && trimmed.len() > 10 // Allow for minimal metadata | ||||||
| } | ||||||
|
|
||||||
| /// Spawn the engine''' | ||||||
|
|
||||||
| if marker in content: | ||||||
| content = content.replace(marker, helper_fn) | ||||||
| print("OK: helper function added") | ||||||
| else: | ||||||
| print("WARN: marker not found for helper function") | ||||||
|
|
||||||
| with open(file_path, 'w', encoding='utf-8') as f: | ||||||
| f.write(content) | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| ## Summary | ||
|
|
||
| Auto-collapse completed sub-agents in the Agents sidebar panel. Non-running agents now show only a single line (label), freeing vertical space for active agents. | ||
|
|
||
| ## Problem | ||
|
|
||
| Completed/failed/interrupted/cancelled sub-agents each occupied **2 lines** in the sidebar (label + detail line), wasting space that could be used for running agents or other content. With many agents, the sidebar became unnecessarily crowded. | ||
|
|
||
| ## Solution | ||
|
|
||
| In `subagent_panel_lines()`, check the agent status before rendering the detail line. If the agent is not running (i.e. completed, failed, interrupted, cancelled), skip the detail line entirely and only render the single-line label. | ||
|
|
||
| **Before:** | ||
| ``` | ||
| ✓ explore foo ← 2 lines per agent | ||
| abc123 · 3 steps · 12.3s | ||
| ✗ build failed ← 2 lines per agent | ||
| def456 · 7 steps · 45.6s | ||
| ● analysis running ← 2 lines per agent | ||
| ghi789 · 2 steps · 5.1s · parsing output... | ||
| ``` | ||
|
|
||
| **After:** | ||
| ``` | ||
| ✓ explore foo ← 1 line (collapsed) | ||
| ✗ build failed ← 1 line (collapsed) | ||
| ● analysis running ← 2 lines (expanded: label + detail) | ||
| ghi789 · 2 steps · 5.1s · parsing output... | ||
| ``` | ||
|
|
||
| ## File changed | ||
|
|
||
| `crates/tui/src/tui/sidebar.rs` — 5 lines added: `is_completed` check + early `continue` before the detail line. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ## Bug | ||
|
|
||
| When `assistant_text` contains CJK characters (3-byte UTF-8), the byte slice | ||
| `&assistant_text[..SUMMARY_LIMIT.saturating_sub(3)]` (byte 277) can land in | ||
| the middle of a multi-byte sequence, causing a panic: | ||
|
|
||
| ``` | ||
| byte index 277 is not a char boundary (it is inside a 3-byte UTF-8 sequence) | ||
| ``` | ||
|
|
||
| ## Fix | ||
|
|
||
| Replace the raw byte-index slice with `truncate_with_ellipsis()` which already | ||
| finds the nearest safe char boundary via `char_indices()`. | ||
|
|
||
| ## Change | ||
|
|
||
| ```diff | ||
| -format!("{}...", &assistant_text[..SUMMARY_LIMIT.saturating_sub(3)]) | ||
| +crate::utils::truncate_with_ellipsis(&assistant_text, SUMMARY_LIMIT, "...") | ||
| ``` | ||
|
|
||
| 1 line changed. | ||
|
|
||
| ## Files | ||
|
|
||
| - crates/tui/src/runtime_threads.rs:1437 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The optional `fuzz` parameter was required to attempt the leading-indentation fuzzy fallback when exact search found zero matches. This forced the model to make two calls on every edit that needed fuzzy matching (first without fuzz -> error -> second with fuzz: true), causing a round-trip delay. | ||
|
|
||
| Fix: remove the `fuzz` gate from the count == 0 branch. The tool now automatically retries with indentation-tolerant fuzzy matching when exact search produces no results. The `fuzz` parameter is kept in the schema for backward compatibility but marked deprecated. | ||
|
|
||
| Changes: | ||
| - crates/tui/src/tools/file.rs: `if count == 0 && fuzz` -> `if count == 0` (always retry fuzzy fallback) | ||
| - crates/tui/src/tools/file.rs: removed dead `else if count == 0 { error }` branch | ||
| - crates/tui/src/tools/file.rs: updated description to note automatic fuzzy fallback | ||
| - crates/tui/src/tools/file.rs: marked fuzz parameter as deprecated in schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch file seems to be a temporary or local file that was committed by accident, as it is not mentioned in the PR description and does not seem to be used by any automated process in the repository. If it is indeed a temporary file, please remove it from the PR.