Skip to content

Comments

refactor: box Image variant and erase ToolExecutor generic from Agent#677

Merged
bug-ops merged 4 commits intomainfrom
feat/625-memory-layout-optimization
Feb 20, 2026
Merged

refactor: box Image variant and erase ToolExecutor generic from Agent#677
bug-ops merged 4 commits intomainfrom
feat/625-memory-layout-optimization

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 20, 2026

Summary

Closes #625, closes #657, closes #660

Changes

  • crates/zeph-llm/src/provider.rsImageData struct, Image(Box<ImageData>) variant
  • crates/zeph-tools/src/executor.rsErasedToolExecutor trait with blanket impl
  • crates/zeph-core/src/agent/Agent<C> without T, 8 impl files updated
  • crates/zeph-llm/src/claude.rs, ollama.rs, openai.rs — Image construction updated
  • src/main.rs — simplified Agent construction

Test plan

  • 2043 workspace tests pass, 0 failures
  • clippy zero warnings, fmt clean
  • Performance reviewed: vtable overhead negligible (~100ns vs ms tool calls)
  • Serde round-trip for ImageData verified

@github-actions github-actions bot added documentation Improvements or additions to documentation llm LLM provider related rust core refactor size/L labels Feb 20, 2026
@bug-ops bug-ops linked an issue Feb 20, 2026 that may be closed by this pull request
@bug-ops bug-ops force-pushed the feat/625-memory-layout-optimization branch from 92f7c0b to 497efe0 Compare February 20, 2026 01:15
@github-actions github-actions bot added size/XL and removed size/L labels Feb 20, 2026
@bug-ops bug-ops force-pushed the feat/625-memory-layout-optimization branch 2 times, most recently from 431af10 to 8662db5 Compare February 20, 2026 01:22
Box<ImageData>, reducing enum variant size from 48 to 8 bytes.
Update all construction and pattern match sites across providers,
agent, and tests.

Add ErasedToolExecutor object-safe trait with boxed futures as a
blanket impl over ToolExecutor. Agent now stores Box<dyn ErasedToolExecutor>,
simplifying all impl blocks and removing monomorphization noise.
@bug-ops bug-ops force-pushed the feat/625-memory-layout-optimization branch from 8662db5 to 71c0402 Compare February 20, 2026 01:24
@bug-ops bug-ops enabled auto-merge (squash) February 20, 2026 01:28
Remove obsolete second generic argument from Agent<MockChannel, ShellExecutor>
to match the simplified Agent<C> signature after ToolExecutor erasure.
@github-actions github-actions bot added the tests label Feb 20, 2026
@bug-ops bug-ops merged commit 021ad3f into main Feb 20, 2026
20 checks passed
@bug-ops bug-ops deleted the feat/625-memory-layout-optimization branch February 20, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core documentation Improvements or additions to documentation llm LLM provider related refactor rust size/XL tests

Projects

None yet

1 participant