Files
hermes-agent/tools
teknium1 124b5c7d45 fix(review): key cwd/override records by the session's own profile home; keep /p/<launch>/ ids stable
Independent-review minors on #126157 (#123989 class):

- session.create is a plain @method, so tui_gateway/session_workdir.py::_register_session_cwd
  wrote the cwd record under the RAW session key while the scoped turn read
  profile:<p>:<key> and missed it until the first `cd`. The writer now binds the
  session's own profile_home around register_task_env_overrides.
- tools/terminal_tool.py::_task_env_overrides stayed raw-keyed, so two profiles
  registering the same task id (docker_image / cwd) still collided. Writer, clear
  and both readers (_has_isolation_overrides, resolve_task_overrides) now use
  _qualify_task_key; the isolation-override branch of _resolve_container_task_id
  returns the qualified key so the env cache and the override record agree.
- gateway/platforms/api_server.py::_derive_chat_session_id prefixed the seed for
  the NAMED LAUNCH profile addressed via /p/<launch>/, so prefixed and
  un-prefixed requests on one profile derived different ids. The prefix is now
  skipped when the routed name is the process's launch profile
  (_names_launch_profile vs get_routing_process_hermes_home()).

Tests (red on 3720519199c, green here):
  tests/tui_gateway/test_session_cwd_profile_key.py::test_secondary_profile_session_cwd_is_found_inside_its_scope
  tests/gateway/test_api_server.py::TestDeriveChatSessionId::test_launch_profile_prefix_keeps_the_unprefixed_id
2026-09-28 04:34:30 -07:00
..