Skip to content

Start a new chat in any workspace from the eca-workspaces dashboard - #315

Merged
ericdallo merged 2 commits into
editor-code-assistant:masterfrom
agzam:workspaces-new-chat-any-directory
Sep 15, 2026
Merged

ericdallo merged 2 commits into
editor-code-assistant:masterfrom
agzam:workspaces-new-chat-any-directory

Conversation

@agzam

@agzam agzam commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

TL;DR

+ in the eca-workspaces dashboard now asks which workspace to start the chat in, and takes any existing directory, not just the workspaces that already have a running session.


Problem

eca-workspaces-new-chat resolved its workspace through eca-workspaces--read-session, which returns the session at point and otherwise runs completing-read with require-match over eca--sessions. Two consequences:

  • A directory without a running session was unreachable. Nothing in the dashboard could create a session, and the picker refused any input that was not already a session.
  • The picker itself was hard to reach. Chat rows carry the eca-workspaces-session-id text property too, so every row short-circuited it; only the footer and the trailing blank line reached the prompt, and only with two or more sessions running.

Change

  • eca-workspaces--read-workspace always prompts, listing the running workspaces with the one at point first. It passes require-match nil, so any other input is expanded and validated as a directory, and appends an Other directory... entry that calls read-directory-name. A path that is not a directory signals Not a directory: PATH.
  • + RET on a row costs the same as before: the workspace at point is both the first candidate (display-sort-function identity) and completing-read's DEF, so it is selected on empty input under vertico and the default UI alike.
  • A picked directory with no session starts one. A path inside a running workspace reuses that session via the new eca-session-for-root, instead of spawning a second server for the same repo.
  • eca-start-session extracts the status pcase out of the eca command so the dashboard can start a session, and eca--initialize takes an optional ready callback. That callback sends the optional initial prompt into a session that did not exist when the prompt was typed.

The initial prompt question is unchanged.

Testing

12 new buttercup specs cover candidate ordering, the default, typed paths, tilde expansion, the missing-directory error, session reuse for a subdirectory, and the initial prompt on both the running and the freshly started path. Full suite: 640 specs, 0 failed. Byte-compile, checkdoc and package-lint report only warnings that reproduce on master.

`+` could only reach workspaces that already had a running session:
the picker offered `eca--sessions` with `require-match`, and nothing in
the dashboard could create a session. It was also skipped entirely
whenever point sat on a row, since chat rows carry the session id too,
so the picker was reachable only from the footer and only with two or
more sessions running.

The picker now always asks, defaults to the workspace at point, and
takes any other input as a directory to start a session in. A path
inside a running workspace reuses that session instead of spawning a
second server.

`eca-start-session` extracts the status dispatch out of the `eca`
command so the dashboard can start a session too, and `eca--initialize`
gained a ready callback so the optional initial prompt can be sent into
a session that did not exist when it was typed.

@ericdallo ericdallo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks!

@ericdallo
ericdallo merged commit f049ab6 into editor-code-assistant:master Sep 15, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants