Skip to content

fix(core): decouple process/ from sessions/ module#616

Merged
Wirasm merged 2 commits into
mainfrom
kild/fix-process-session-coupling
Feb 27, 2026
Merged

fix(core): decouple process/ from sessions/ module#616
Wirasm merged 2 commits into
mainfrom
kild/fix-process-session-coupling

Conversation

@Wirasm

@Wirasm Wirasm commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Inverts the bidirectional dependency between process/ and sessions/process/cleanup.rs no longer imports Session
  • Renames cleanup_session_pid_filescleanup_pid_files accepting &[String] PID keys instead of &Session
  • Adds Session::pid_keys() method to keep session-aware key extraction in the session domain

After this change, process/ is a pure lower-level utility module with zero imports from sessions/.

Test plan

  • cargo fmt --check passes
  • cargo clippy --all -- -D warnings passes
  • cargo test --all passes (3 pre-existing failures in resolve_self_branch tests unrelated to this change)

Closes #589

process/cleanup.rs imported Session from sessions/, creating a
bidirectional dependency between what should be a lower-level utility
module and the session domain.

Invert the dependency: rename cleanup_session_pid_files to
cleanup_pid_files accepting &[String] (PID keys) instead of &Session.
Add Session::pid_keys() method so the session-aware key extraction
stays in sessions/types where it belongs.

After this change, process/ has zero imports from sessions/.

Closes #589
Address review findings:
- Restore warn! log in pid_keys() when session has no tracked agents
  (diagnostic signal was accidentally dropped during refactor)
- Clarify pid_keys() doc to mention empty-spawn-id edge case and
  potential duplicate keys for legacy agents
- Reference get_pid_file_path in cleanup_pid_files doc for path format
@Wirasm Wirasm merged commit f853254 into main Feb 27, 2026
6 checks passed
@Wirasm Wirasm deleted the kild/fix-process-session-coupling branch February 27, 2026 07:22
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.

Fix process/ ↔ sessions/ bidirectional coupling

1 participant