Repository navigation
fix(bot-mode): scope Bot Chat session lookup to the target profile's home - #105323
yoyodine-industries wants to merge 4 commits into
Conversation
|
Post-merge scope check: leaving this PR open, not treating it as superseded. #105442 ( |
d1d6ef4 to
bc167fb
Compare
|
Ready for review — scopes Bot Chat session lookup to the target profile's home. Mergeable on current main; CI needs a maintainer to approve-and-run. Thanks! |
|
Merged current main in to clear the conflict — upstream reworked the relay sender plumbing in the meantime, so a plain rebase wasn't clean. Kept both sides: upstream's author=author and our _bot_chat_turn_args(resolved, root) scoping of the Bot Chat lookup to the target profile's home. Run: tests/tools/test_bot_mode_dm.py + tests/tools/test_bot_relay_windows_paths.py -> 55 passed, 1 skipped. Mergeable again. |
…home message_agent delivery ran 'hermes -p <profile> chat --in ~ -c Bot Chat', and '--in ~' scoped the session lookup to the shared home directory, which for a named profile resolves to the DEFAULT profile's workspace. If the default profile's Bot Chat was held live by the desktop surface, delivery failed with 'already has a live owner' and surfaced as target_busy — affecting DMs to any bot on the install. Resolve --in to the target profile's own home (root for 'default', else root/profiles/<name>) via a new profile_home_dir() helper in bot_mode_probe; bot_relay gains _bot_chat_turn_args(profile, root) that builds the scoped argv, and bot_mode_dm uses it.
3b69f58 to
12dbbe1
Compare
# Conflicts: # tools/bot_relay.py
…ssion-to-profile-home
…ssion-to-profile-home Union resolution in tools/bot_mode_dm.py: the branch's _bot_chat_turn_args(profile, root) scoping is kept, upstream's _hermes_cli() is taken. Upstream's side of the hunk imported BOT_CHAT_TURN_ARGS, which this branch replaced with the scoped helper, so taking it verbatim would have been an ImportError. tools/bot_relay.py auto-merged coherently: _bot_chat_turn_args() still scopes --in to the target profile's own home and upstream's new local_delivery_command() now routes through it; no other module builds a --in argv. One upstream test (test_delivery_pins_the_hermes_entrypoint_beside_this_interpreter, the entrypoint-pinning regression) asserted the OLD argv with --in ~ and so encoded the bug this branch fixes. Its expectation now names the profile home, matching the branch's scoping tests. Verified: scripts/run_tests.sh tests/tools/test_bot_mode_dm.py tests/tools/test_bot_relay_windows_paths.py tests/tools/test_bot_mode_probe.py -> 75 passed, 1 skipped (windows-only).
|
Closing as superseded, per your note on #105460: main's live-owner delivery path ( For the record: we're running v0.21.3 and have seen no |
Problem
message_agentdelivery runshermes -p <profile> chat --in '~' -c 'Bot Chat'.tools/bot_relay.pyhard-coded the turn args as:--in ~scopes the session lookup to the shared home directory, which for a named profile resolves to the default profile's workspace. When the default profile's Bot Chat session is held "live" by the desktop surface, delivery fails withalready has a live owner, surfaced to the sender astarget_busy— breaking DMs to any bot on the install (coder, majordomo, …).Fix
Scope the
-c "Bot Chat"lookup to the target profile's own home:tools/bot_mode_probe.py: addprofile_home_dir(root, name)—rootfor"default", elseroot/profiles/<name>(inverse of the existing_hermes_root/_profile_namepair).tools/bot_relay.py: replace the constantBOT_CHAT_TURN_ARGSwith_bot_chat_turn_args(profile, root), which builds the profile-scoped argv, and routelocal_delivery_commandthrough it.tools/bot_mode_dm.py:message_agent_toolnow passes_bot_chat_turn_args(resolved, root)into the delivery argv.Test
test_local_delivery_scopes_in_to_profile_home: asserts--inresolves toroot/profiles/<profile>(and torootfor the default profile).test_local_delivery_command_and_ackupdated to the profile-scoped--in.Both proven red on base, green with the fix.
Related Issue
Fixes #105460
Type of Change
Checklist
Code
scripts/run_tests.sh tests/tools/test_bot_relay_windows_paths.py tests/tools/test_bot_mode_dm.py tests/tools/test_bot_turn_lock.pyand all tests passDocumentation & Housekeeping
cli-config.yaml.example— or N/A (no config keys added or changed)CONTRIBUTING.mdorAGENTS.md— or N/A (no contribution/agent-instruction change)message_agenttool interface unchanged)