Repository navigation
feat(acp-bridge): list sessions under their Paseo project directory - #189
Merged
Merged
Conversation
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.
Application stack block#197: #179 → #182 → #187 → #191 → #180 → #186 → #189 → #188 → #194 → #196. Merge from the bottom upward.
Problem
After a Paseo daemon pod is replaced,
$HOME(anemptyDir) is gone and Paseo shows "No sessions for this host". The conversations still exist as Buzz threads, and the bridge'ssession/listreturns them. But every entry had"cwd":"/"and the bridge ignored Paseo'scwdfilter. Paseo requires a session's working directory to exist (assertUsableWorkingDirectory) and groups sessions by project path, so restored conversations had no project and no usable directory.This is Phase 1 of fix B2 in the Paseo fix plan: the bridge part of "History and file paths do not survive". It does not include transcript replay or path rewriting.
Change
Project tag (
session/new). When the client'scwdis one of the following, the thread root that the bridge creates records["paseo-project","<owner>/<repo>"]:$HOME/code/<owner>/<repo>$HOME/code/<owner>/<repo>@<branch>The path is normalised lexically. The owner must be 1 to 39 ASCII letters, digits,
-, or_, and must not start with-. The repository must be 1 to 100 ASCII letters, digits,.,-, or_, and must not be.or... Any othercwdrecords nothing.Tag trust. The bridge uses the tag only on a root that the owner or the bridge's own signer authored (the same
authors(scope)set that session aliases use). It ignores the tag on roots by other channel members.Loaded sessions (
session/load). A loaded thread takes its project from a trusted, valid root tag. When the root has none, the session takes the project of the client'scwd. In both cases,/freshtags the new root.Listed
cwd(session/list).cwdpaseo-projecttag, authored by the owner or the signer, and$HOME/code/<owner>/<repo>exists$HOME/code/<owner>/<repo>$HOME/buzz, created with mode 0700 when missing$HOME/buzzcannot be created$HOMEcwdfilter. The filter is mapped the same way, and the bridge keeps only sessions whose listedcwdis equal to it:@branchview, or a subdirectory of either selects the project directory.$HOME/buzzor a subdirectory of it selects$HOME/buzz.Sessions that the filter excludes still advance the cursor. The paging rules are unchanged: a page can be short or empty and still return
nextCursor.Ended sessions (follow-up to #187). The ended notice and the
/recovercommand no longer say that recovery needs the Buzz app. The notice quotes the manager's own reason, and the offered commands depend on that reason:session_ended,session_ending,recovery_interrupted,recovery_mode_conflictin #187)/recoverand/freshno_checkpoint), or only points to a new thread (for example, a manager without #187)/freshonly/recoverresends the message in the thread. The text says that this mentions the agent again so that its manager can try to restore the session. It does not promise a restore. The bridge still accepts a typed/recoverwhen it is not offered. The bridge still matches the manager's prefixThis thread's agent session ended.Scopegainshome(fromdirs::home_dir(), or/when there is none), so tests can use a temporary home.Merge and deploy order
The recovery wording assumes that #187's sandbox manager is deployed before this bridge reaches the daemon image, or in the same rollout. With an older manager, the notice ("Recover it from desktop, or mention me in a new thread.") does not invite a mention in the thread, so the bridge offers only
/fresh. A typed/recoverstill works after a recovery in the Buzz app.Validation
cargo fmt --all: clean.cargo clippy -p buzz-cli --all-targets -- -D warnings: clean.cargo test -p buzz-cli: 554 passed.cargo clippy -p buzz-cli --all-targets --target x86_64-pc-windows-msvc. The target is not installed. The only unix-only API in the new tests (PermissionsExt) is now under#[cfg(unix)]. CI's Windows Rust job runs this clippy.New and changed tests. They drive the production bridge loop over in-memory stdio with the relay fake and a temporary
HOME:history_tests::sessions_list_under_their_recorded_project_directory:session/newin…/code/block/buzz@feat/x/srctags the rootblock/buzz.session/newin/tmp/elsewhereand in$HOMEadds no tag.../etc(with$HOME/etcpresent), two tags, and a root by another member tagged with the existing project. The first lists under its project directory, and the other five list under$HOME/buzz. On unix,$HOME/buzzis created with mode 0700./,@main, a subdirectory, and a..path select the project.$HOME/buzzand$HOME/buzz/notesselect the fallback roots. The missing project path, another project,$HOME, and a relative path select nothing.no_checkpointnotice. The notice is quoted, onlyfreshis advertised, and/recoveris not mentioned. Then/fresh: the tagged root (loaded withcwd$HOME) keepsblock/buzz; the untagged root (loaded in…@main) takesblock/buzz; the member's tagged root (loaded in/tmp/elsewhere) gets no tag.history_tests::sessions_list_under_home_when_the_buzz_directory_cannot_be_created:$HOME/buzzis a file, so the session lists under$HOME. The filter$HOMEincludes it, and the filter$HOME/buzzexcludes it.tests::ended_notices_offer_recover_only_when_a_mention_here_may_restore: one row per feat(manager): recover ended threads from owner and gateway mentions #187 notice, plus the pre-feat(manager): recover ended threads from owner and gateway mentions #187 notice and the bare prefix.tests::acp_session_drives_a_remote_agent_through_the_relay: with feat(manager): recover ended threads from owner and gateway mentions #187'ssession_endednotice, the bridge quotes it, offersrecoverandfresh, and says the manager "can try to restore the session", not that it restores the checkpoint.projects::tests: two tables, one for mappingcwdto a project and one for GitHub name rules.Mutation checks. Each mutation was applied, the named test failed, and the mutation was reverted:
sessions_list_*testssessions_list_under_their_recorded_project_directorysessions_list_under_their_recorded_project_directory(the/freshstep)valid_projectnot checked on root tagssessions_list_under_their_recorded_project_directory(../etclists as$HOME/code/../etc)sessions_list_under_their_recorded_project_directorysessions_list_under_their_recorded_project_directory(member/freshtagged)sessions_list_under_their_recorded_project_directory(untagged/freshuntagged)/recoveralways offeredended_notices_offer_*,sessions_list_under_their_recorded_project_directory/recovernever offeredended_notices_offer_*,acp_session_drives_a_remote_agent_through_the_relayNot verified
~/code/<owner>/<repo>, or Paseo'scwdfilter values on the wire.~/buzz. The daemon (B3) must register~/buzzas a project, and its startup restore is still to do./recoveroffer is chosen by matching the manager's notice text (me here,cannot be restored). If feat(manager): recover ended threads from owner and gateway mentions #187's wording changes, this match must change with it.Summary by CodeRabbit
/recoveris offered when the notice indicates mention-based recovery may work, while/freshstarts a new session and workspace.Current revision
The Unix-only directory mode now uses a scoped mutable builder. This fixes Windows Clippy without weakening owner-only directory creation. The session-project and fallback tests passed. The complete downstream CLI test suite also passed before splitting the replay layers.
Opened for review with scoped validation; current CI and live staging checks are tracked separately.
Combined stack check
The current combined source passed CLI (569), SDK (359), manager (166), and Kubernetes backend (226) library tests, executable tests, and scoped Clippy. The full
just ciattempt passed workspace Rust lint and stopped at missing desktopgio-2.0dependencies. Live staging checks remain for rollout.