Skip to content

fix(gateway): isolate soul by chat#1222

Open
ymote wants to merge 1 commit into
mainfrom
fix/soul-isolate-chat-profile-626
Open

fix(gateway): isolate soul by chat#1222
ymote wants to merge 1 commit into
mainfrom
fix/soul-isolate-chat-profile-626

Conversation

@ymote

@ymote ymote commented May 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Store gateway /soul overrides under a profile/channel/chat-scoped session path instead of the shared profile data root.
  • Read/write/reset /soul using the inbound message profiled base session key so Telegram/Discord chats and profiles do not overwrite each other.
  • Append the scoped soul override when spawning new session actors so the setting takes effect for new sessions.
  • Add regressions for chat isolation, profile isolation, topic base-key sharing, and reset not clearing soul for another chat.

Closes #626

Current refresh

  • Base: origin/main 1df02bd
  • Head: 72b3ff9
  • Refreshed from a clean isolated clone; no generated artifacts or untracked files included.

Validation

  • git diff --check origin/main...HEAD
  • rustfmt --check crates/octos-cli/src/gateway_dispatcher.rs crates/octos-cli/src/session_actor.rs crates/octos-cli/src/soul_service.rs
  • cargo fmt --all -- --check
  • CARGO_TARGET_DIR=/private/tmp/octos-1222-refresh-target CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo test -p octos-cli soul_service::tests -- --nocapture (7 passed)
  • CARGO_TARGET_DIR=/private/tmp/octos-1222-refresh-target CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo test -p octos-cli gateway_dispatcher::tests::should_isolate_soul -- --nocapture (2 passed)
  • CARGO_TARGET_DIR=/private/tmp/octos-1222-refresh-target CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo test -p octos-cli gateway_dispatcher::tests -- --nocapture (34 passed)
  • CARGO_TARGET_DIR=/private/tmp/octos-1222-refresh-target CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo clippy -p octos-cli --all-targets --no-deps
  • CARGO_TARGET_DIR=/private/tmp/octos-1222-refresh-target CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo clippy -p octos-cli --all-targets --features api --no-deps (exits 0 with existing unrelated warning noise)
  • git status --short --branch and git ls-files --others --exclude-standard in the isolated clone show no untracked/generated files.

Notes

  • Full clippy with -D warnings remains blocked by pre-existing warnings outside this slice, so this refresh records the clean exit of the repository-standard clippy invocation without widening the PR.

CI / merge status

  • GitHub CI is green on head 72b3ff9a7b728617a34058b09545ecc2436b13af: check, test-octos-cli, test-octos-agent (lib), test-octos-agent (integration), dashboard, swarm-app, check-matrix, typos, and author-email passed. Optional platform/e2e/security expansion jobs were skipped by workflow conditions.
  • Current GitHub state remains MERGEABLE but branch-protection blocked by required review (BLOCKED / REVIEW_REQUIRED).
  • Bug: Soul Configuration Not Properly Isolated Across Multiple Profiles/Users #626 should close through this PR after review and merge; no manual closure was performed.

@ymote ymote requested a review from bobdingAI May 28, 2026 11:34
@ymote

ymote commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Current-main validation for #626 on 2026-05-29.

Validated PR head 3733aed1a8da98ad693d88c9dc3d0690049de6c3 by cleanly merging it onto current origin/main 1fb4c88e020242d82cee245b331798ed6dc551e7 in /private/tmp/octos-1222-current-Cl0yOk; local rehearsal merge commit was 62beb8a313907e89f8709f5c956a334ed4d96c57.

Acceptance evidence:

  • /soul read/write/reset now use a profiled base chat key, so profile/channel/chat isolate the soul while topic sessions for the same chat share it.
  • SessionActor appends the scoped soul for the spawned session key when building the system prompt.
  • Tests cover per-chat isolation, per-profile isolation, topic sharing for the same chat, and reset not clearing another chat soul.

Commands run:

  • git diff --check origin/main...HEAD passed.
  • rustfmt --check crates/octos-cli/src/gateway_dispatcher.rs crates/octos-cli/src/session_actor.rs crates/octos-cli/src/soul_service.rs passed.
  • cargo test -p octos-cli soul_service::tests -- --nocapture passed: 7 passed.
  • cargo test -p octos-cli gateway_dispatcher::tests::should_isolate_soul -- --nocapture passed: 2 passed.
  • cargo test -p octos-cli gateway_dispatcher::tests -- --nocapture passed: 34 passed.
  • cargo clippy -p octos-cli --all-targets --no-deps passed.
  • cargo clippy -p octos-cli --all-targets --features api --no-deps passed with existing warnings.

Environment: rustc 1.95.0 (59807616e 2026-04-14), cargo 1.95.0 (f2d3ce0bd 2026-03-21), Darwin 25.5.0 arm64. Build/test artifacts were confined to /private/tmp/octos-1222-current-1fb4-*; git ls-files --others --exclude-standard was empty after validation.

Remaining gap: cargo fmt --all -- --check still fails on current-main formatting drift outside this PR diff, observed in crates/octos-cli/src/api/ui_protocol_ledger.rs. GitHub reports this PR as MERGEABLE but branch protection is BLOCKED because review is still required, so I did not merge it.

@ymote ymote force-pushed the fix/soul-isolate-chat-profile-626 branch from 3733aed to 72b3ff9 Compare June 1, 2026 12:38
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.

Bug: Soul Configuration Not Properly Isolated Across Multiple Profiles/Users

1 participant