Repository navigation
feat(cli): --continue, session picker, /resume, --version, doctor - #37
Merged
Merged
Conversation
Sessions now record the directory they were started in, so devorch --continue (-c) reopens the latest non-empty conversation from the current directory. A bare --resume (rewritten at the entry point, since Typer cannot take an optional value) opens a picker, and /resume switches session inside the REPL. Add --version and a read-only doctor command that never prints key values and warns about pre-approved edit permissions. Also fix resumed messages loading out of order when saved within the same second, and make every test start with an empty throwaway home.
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
Session handling and diagnostics, modelled on what people expect from similar tools.
Continuing and resuming
cwdcolumn, migrated automatically; paths are normalized so symlinks and Windows case differences match)devorch --continue/-c: reopen the most recent non-empty conversation started in the current directory. If there is none it says so and starts a new sessiondevorch --resumewith no ID opens an arrow-key picker: this directory's sessions first (labelled by what you first asked, notSession 2026-10-31 15:53), with "Show sessions from all directories…"; falls back to all directories when this one has none.--resume <id>works as before and wins over--continue/resume [id]switches session inside the REPL: loads the history and summary, resets checkpoints and tasks (they belong to the conversation you left), keeps your current provider/model and notes if the session used another, and shows the last exchange so you see where you left offsessions list --here//sessions list [n] [here], plus a Directory column--continueand the picker skip empty sessions; and resumed messages were loadedORDER BY created_at(one-second precision), so messages saved in the same second could come back out of order. They now load in saved order, and recency ties are broken by message id--version/-V, anddevorch doctor(/doctor)A read-only report meant to be pasted into bug reports: runtime, config folder, API keys (only "set/missing", never values), default provider, OS keychain, permissions, project instructions and trust, MCP, sessions, git, clipboard tool, Pillow, terminal and encoding. It warns when edit/filesystem/shell are pre-approved (the situation behind the earlier accidental edits), a check that crashes becomes a failed row instead of killing the report, long paths fold instead of being cut off, and the exit code is 1 if anything failed.
One thing worth knowing
Typer cannot express an option with an optional value: a bare
--resumeerrors, and--resume -cswallows-cas the ID (verified with a probe). So the entry point rewrites a value-less--resume/-rinto an internal marker (normalize_resume_argv, 12 cases tested). Running the app through anything other thanmain()(e.g.CliRunner) does not apply the rewrite.Also in this PR
tests/conftest.pynow gives every test an empty~/.devorchinside the throwaway home from #35. With one shared home, sessions saved by one test were visible to the next (this surfaced while writing these tests).Tests (+68)
--version, options registered on the REPL entry points, version inpyproject.tomlmust equalcli.constants.VERSION(a release guard for the two-places problem)ruffclean; run with the real~/.devorchuntouched (checked by file mtime)Not exercised
The interactive paths (the questionary picker,
/resumein a live REPL,--continuestarting a real session) were not run in a real terminal: I tested the logic with scripted choosers and a fake agent.