Repository navigation
Require an account when a session id is in several accounts - #28
Merged
Merged
Conversation
A session id can exist in several accounts with different histories and usage. Show the existing sessions table when a read is ambiguous, then require an explicit account before opening a copy. Keep follow-up commands qualified. Constraint: Account copies have independent transcripts and costs Rejected: Pick the most recently used copy | can hide another account's history Confidence: high Scope-risk: moderate Tested: go test ./...; go vet ./...; real duplicate-id show and view commands
Side files in another account are not alternate main transcripts. Resolve a bare id to its sole main copy, and list full references in the same order as the candidate table when several main copies exist. Constraint: Session ids may also appear in sidecar and subagent files Rejected: Offer every account with any matching file | some have no main transcript Confidence: high Scope-risk: narrow Tested: go test ./...; go vet ./...; real side-file and duplicate-id sessions
With --json, a reference that names a session in several accounts printed a sessions page with exit status 1, so a script could only tell the choice from a real answer by the status. It now prints an object with "error": "ambiguous", the reference as given, the id it matched, a full reference per copy in table order, and the candidate rows. The shape is new on this branch, so nothing depended on the page form. Tested: go test ./...; go vet ./...
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
show,log,exportandview <id>used to open the most recently used copy when a session id was in several accounts, with only a note on stderr. They now list the copies with the same columns asccli sessionsand exit with status 1 until you name an account (-a <account>or<account>:<id>). Follow-up commands printed byshowandlogcarry the account, so they cannot be ambiguous again.account:idreferences in table order.--json, the choice is its own object:error: "ambiguous",ref,id,choose(a full reference per copy) andsessions(the rows).Test plan
go test ./...,go vet ./...-aoraccount:idccli show 1087b979lists talcum and default with their costs