Context
Follow-up from #71 (Clippy allow audit). Five #[allow(clippy::too_many_arguments)] sites remain in the Claude connector:
connector-claude/src/lib.rs — ClaudeConnector::new (8 params)
connector-claude/src/lib.rs — event_loop (6 params, all Arc<Mutex>)
connector-claude/src/lib.rs — dispatch_stdout_message (14 params — worst case in codebase)
connector-claude/src/lib.rs — handle_assistant_message (9 params)
connector-claude/src/session.rs — ClaudeSession::new (9 params, public API)
Why these were deferred
The Claude connector uses a shared-state pattern where multiple Arc<Mutex<>> references are passed through the event loop pipeline. Refactoring requires either:
- Introducing a
ClaudeEventLoopState struct that groups the shared state (preferred)
- Or restructuring the connector to use an actor/struct with methods
ClaudeSession::new is a public API boundary — changing it requires coordinating all callers.
dispatch_stdout_message with 14 parameters is the single worst offender in the codebase and would benefit most from a state struct.
Recommended approach
- Create
ClaudeEventLoopState grouping the Arc<Mutex> fields
- Refactor
event_loop → dispatch_stdout_message → handle_assistant_message chain to pass the struct
- Create
ClaudeSessionConfig for ClaudeSession::new / ClaudeConnector::new
Acceptance Criteria
- All 5
#[allow(clippy::too_many_arguments)] in connector-claude removed
make rust-ci passes
Follow-up from #71: I_kwDORFu4Vs71Vr9-
Context
Follow-up from #71 (Clippy allow audit). Five
#[allow(clippy::too_many_arguments)]sites remain in the Claude connector:connector-claude/src/lib.rs—ClaudeConnector::new(8 params)connector-claude/src/lib.rs—event_loop(6 params, all Arc<Mutex>)connector-claude/src/lib.rs—dispatch_stdout_message(14 params — worst case in codebase)connector-claude/src/lib.rs—handle_assistant_message(9 params)connector-claude/src/session.rs—ClaudeSession::new(9 params, public API)Why these were deferred
The Claude connector uses a shared-state pattern where multiple
Arc<Mutex<>>references are passed through the event loop pipeline. Refactoring requires either:ClaudeEventLoopStatestruct that groups the shared state (preferred)ClaudeSession::newis a public API boundary — changing it requires coordinating all callers.dispatch_stdout_messagewith 14 parameters is the single worst offender in the codebase and would benefit most from a state struct.Recommended approach
ClaudeEventLoopStategrouping the Arc<Mutex> fieldsevent_loop→dispatch_stdout_message→handle_assistant_messagechain to pass the structClaudeSessionConfigforClaudeSession::new/ClaudeConnector::newAcceptance Criteria
#[allow(clippy::too_many_arguments)]in connector-claude removedmake rust-cipassesFollow-up from #71: I_kwDORFu4Vs71Vr9-