Repository navigation
Conversation
A scheduled job that started a turn in an assistant the UI had not loaded showed up under the foreground assistant: DialogTurnStarted carried no workspace, so the Web UI placeholder fell back to the current workspace. Its saves were then rejected because the session was bound elsewhere. DialogTurnStarted now carries an optional SessionWorkspaceFacts filled from the session config, and the frontend projection exposes it with the same flat keys as session-created. The Web UI places unknown sessions from those facts, including project and execution target. Events from older hosts omit the field and keep the legacy fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A session whose turn is started by the backend (for example, a scheduled job) can appear under the wrong assistant/workspace in the Desktop UI. This happens when the UI has not loaded that session yet.
DialogTurnStartedcarried no workspace facts, so the Web UI placeholder fell back to the foreground workspace.This PR makes the host announce the session's own workspace binding on
DialogTurnStartedand has the Web UI place unknown sessions from it.No existing issue; found while investigating a misplaced scheduled-job session on Desktop.
Type and Areas
Type: bug fix
Areas: Rust core (events contract, coordinator, session manager), web UI (flow chat event handling)
Motivation / Impact
Observed on Desktop:
agentic://dialog-turn-startedfor an unknown session and creates a "Remote Session" placeholder.resolveExternalSessionWorkspacefinds no workspace facts on the event. It falls back tocurrentWorkspaceId/currentWorkspacePath, so S appears under assistant B.Session ID is already bound to another workspace, which also breaksget_session_stats. Persisted data stays correct; restarting the app hides the problem until the next background turn.Changes:
openbitfun-eventsSessionWorkspaceFacts: workspace path and id, project workspace path and id, execution target, remote connection, SSH host.DialogTurnStartedgets an optionalsession_workspacefield (#[serde(default, skip_serializing_if = "Option::is_none")]).agentic://session-created. When the field is absent, the payload is unchanged.openbitfun-coreSessionManager::get_session_workspace_factsreads only the config fields.DialogTurnStartedemit sites fill it.handleDialogTurnStartedandhandleSessionCreatedshareresolveExternalSessionBinding.DialogTurnStartedliterals (journal, remote connect, CLI tests) setsession_workspace: None.User-facing: background turns in an assistant the UI has not opened stay under their own assistant. The
already bound to another workspacesave errors stop.Verification
Run on top of current
main:cargo test --locked -p openbitfun-events --lib frontend_projection: 17 passed. New tests cover projection of the binding and a legacy payload without the field: it deserializes, re-serializes unchanged, and projects no workspace keys.cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,git --lib user_shell_command_persists_a_standard_exec_command_tool_turn: passed. It now asserts that the started event announces the session's own workspace path.cargo test --locked -p openbitfun-agent-runtime --features agent-runtime --lib session_event_journal: 18 passed.cargo test --locked -p openbitfun-services-integrations --features remote-connect --test remote_connect_contracts: 81 passed.cargo test --locked -p openbitfun-services-integrations --features remote-connect --lib remote_connect: 219 passed.cargo +1.95.0 check --locked -p openbitfun-cli --tests: ok.vitest run src/flow_chat/services/flow-chat-manager/EventHandlerModule.test.ts: 83 passed. New tests:tsc --noEmiton web-ui: no errors in the changed files.Not run: an end-to-end reproduction in a rebuilt app; remote workspace, remote control, and Peer Device scenarios. Remote control and peer paths go through
project_agentic_frontend_event, so they get the same additive fields, but this was not exercised.Reviewer Notes
Checklist
🤖 Generated with Claude Code