Skip to content

♻️ Refactor Claude connector internals to reduce argument counts#81

Merged
Robdel12 merged 1 commit intomainfrom
mission/robdel12-orbitdock#76
Mar 22, 2026
Merged

♻️ Refactor Claude connector internals to reduce argument counts#81
Robdel12 merged 1 commit intomainfrom
mission/robdel12-orbitdock#76

Conversation

@Robdel12
Copy link
Owner

Summary

  • Introduces ClaudeSessionConfig struct grouping the 8 CLI spawn parameters, replacing positional args in ClaudeSession::new and ClaudeConnector::new
  • Introduces ClaudeEventLoopState struct grouping shared refs and mutable local state, reducing dispatch_stdout_message from 15 params to 2
  • Removes all 5 #[allow(clippy::too_many_arguments)] in connector-claude
  • Updates all 7 call sites across 6 files and adapts sub-handlers (handle_assistant_message, handle_result_message, etc.) to use the state struct

Test plan

  • make rust-ci passes (fmt, clippy, build, tests)
  • No #[allow(clippy::too_many_arguments)] remain in connector-claude
  • All existing tests pass unchanged (test helper constructs minimal state)

Closes #76

Introduce ClaudeSessionConfig and ClaudeEventLoopState structs to
eliminate all 5 #[allow(clippy::too_many_arguments)] in connector-claude.

- ClaudeSessionConfig groups the 8 CLI spawn parameters used by
  ClaudeSession::new and ClaudeConnector::new
- ClaudeEventLoopState groups shared refs (Arc<Mutex>) and mutable
  local state for the event loop pipeline, reducing
  dispatch_stdout_message from 15 params to 2
- Updated all 7 call sites across 6 files to use the config struct
- Updated sub-handlers (handle_assistant_message, handle_result_message,
  etc.) to take &mut ClaudeEventLoopState
@Robdel12 Robdel12 merged commit 32433c6 into main Mar 22, 2026
3 checks passed
@Robdel12 Robdel12 deleted the mission/robdel12-orbitdock#76 branch March 22, 2026 17:48
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.

♻️ Refactor Claude connector internals to reduce argument counts

1 participant