feat: core types added - #12
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new public ChangesCore Type System Definition and Export
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/core/types.rs (1)
494-495: ⚡ Quick winUse
&selfintotal_tokensaccessors instead of taking ownership.Lines 494 and 775 in
src/core/types.rsconsume the value for a read-only operation, which is non-idiomatic and forces unnecessary moves. Change both methods to take&self.Proposed diff
- pub fn total_tokens(self) -> u64 { + pub fn total_tokens(&self) -> u64 { self.input_tokens.saturating_add(self.output_tokens) }- pub fn total_tokens(self) -> u64 { + pub fn total_tokens(&self) -> u64 { self.input_tokens.saturating_add(self.output_tokens) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/core/types.rs` around lines 494 - 495, Change the accessor signatures that currently take ownership to borrow instead: update pub fn total_tokens(self) -> u64 to pub fn total_tokens(&self) -> u64 and do the same for any other read-only accessors in the same module that use self by value; inside the method keep using self.input_tokens.saturating_add(self.output_tokens) and then update callers to pass a reference (or clone if an owned value is required) so you no longer move the struct for a read-only operation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/core.rs`:
- Around line 18-25: The "Supporting Types" documentation table is out of sync
with the public API exported by pub use types::*; — update the table that
currently lists AgentConfig, AgentState, TurnResult, SessionResult, StopReason,
ToolCall, ToolCallResult, and Correction to include all additional public types
exported from the types module so docs match the actual API; locate the table
near the top-level module docs (the block showing the vertical table of
supporting types) and add entries for each missing exported symbol (keep the
existing entries and append the new type names with brief descriptions
consistent with the table format).
---
Nitpick comments:
In `@src/core/types.rs`:
- Around line 494-495: Change the accessor signatures that currently take
ownership to borrow instead: update pub fn total_tokens(self) -> u64 to pub fn
total_tokens(&self) -> u64 and do the same for any other read-only accessors in
the same module that use self by value; inside the method keep using
self.input_tokens.saturating_add(self.output_tokens) and then update callers to
pass a reference (or clone if an owned value is required) so you no longer move
the struct for a read-only operation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5cb22ed4-eca9-4c06-b889-4ffa92c0eebf
📒 Files selected for processing (2)
src/core.rssrc/core/types.rs
No description provided.