Split from the #2437 triage meta-issue (item E). The one concrete coding follow-up. Mirrors the memory/conversation rebind already done in #2445.
Problem
When openhuman-core starts before any user has logged in, it opens its DBs/profiles under ~/.openhuman/users/local/. A later sign-in over RPC calls credentials::ops::store_session, which writes ~/.openhuman/active_user.toml and creates ~/.openhuman/users/<user_id>/. But long-lived subsystems hold a cached Config snapshot from startup and never re-resolve, so they keep writing under users/local/ until a process restart. config::schema::load::resolve_config_dirs only reads active_user.toml on each Config::load.
Current state (verified on main)
store_session_inner (src/openhuman/credentials/ops.rs, ~L426-439) already rebinds after activation:
- memory →
memory::global::init(effective_config.workspace_dir)
- conversation persistence →
register_conversation_persistence_subscriber(...)
Not rebound (this issue):
- Channel runtime —
channels::runtime::startup::start_channels(config: Config) (src/openhuman/channels/runtime/startup.rs:80) captures config.workspace_dir at boot into many long-lived holders; started once, never re-resolved on login.
- Scheduler —
cron::scheduler::run(config: Config) (src/openhuman/cron/scheduler.rs:164), started via scheduler::start(config) (src/openhuman/memory_queue/worker.rs:265); ops read config.workspace_dir (cron/ops.rs:111,175). At login store_session_inner only calls scheduler_gate::set_signed_out(false) (un-pause) — it does not rebind the workspace.
Fix direction
Add a workspace re-resolve/restart seam to the channel runtime and the scheduler, invoked from store_session_inner's rebind block against effective_config.workspace_dir — mirroring the memory rebind. Both subsystems are currently "start-once with a Config snapshot" and need a restart/re-bind entry point added.
Acceptance
- After first login on a long-lived (pre-login-started) core, channel config and scheduled jobs route to
users/<user_id>/, not users/local/.
- Regression test asserting channel-runtime + scheduler re-resolve to the new workspace after
store_session.
Ref: #2437 (parent triage), #2445 (memory/conversation rebind precedent).
Split from the #2437 triage meta-issue (item E). The one concrete coding follow-up. Mirrors the memory/conversation rebind already done in #2445.
Problem
When
openhuman-corestarts before any user has logged in, it opens its DBs/profiles under~/.openhuman/users/local/. A later sign-in over RPC callscredentials::ops::store_session, which writes~/.openhuman/active_user.tomland creates~/.openhuman/users/<user_id>/. But long-lived subsystems hold a cachedConfigsnapshot from startup and never re-resolve, so they keep writing underusers/local/until a process restart.config::schema::load::resolve_config_dirsonly readsactive_user.tomlon eachConfig::load.Current state (verified on
main)store_session_inner(src/openhuman/credentials/ops.rs, ~L426-439) already rebinds after activation:memory::global::init(effective_config.workspace_dir)register_conversation_persistence_subscriber(...)Not rebound (this issue):
channels::runtime::startup::start_channels(config: Config)(src/openhuman/channels/runtime/startup.rs:80) capturesconfig.workspace_dirat boot into many long-lived holders; started once, never re-resolved on login.cron::scheduler::run(config: Config)(src/openhuman/cron/scheduler.rs:164), started viascheduler::start(config)(src/openhuman/memory_queue/worker.rs:265); ops readconfig.workspace_dir(cron/ops.rs:111,175). At loginstore_session_inneronly callsscheduler_gate::set_signed_out(false)(un-pause) — it does not rebind the workspace.Fix direction
Add a workspace re-resolve/restart seam to the channel runtime and the scheduler, invoked from
store_session_inner's rebind block againsteffective_config.workspace_dir— mirroring the memory rebind. Both subsystems are currently "start-once with a Config snapshot" and need a restart/re-bind entry point added.Acceptance
users/<user_id>/, notusers/local/.store_session.Ref: #2437 (parent triage), #2445 (memory/conversation rebind precedent).