Skip to content

Add MVP AI session dashboard with shared session registry#356

Merged
tninja merged 11 commits into
mainfrom
copilot/add-ai-coding-session-dashboard
May 17, 2026
Merged

Add MVP AI session dashboard with shared session registry#356
tninja merged 11 commits into
mainfrom
copilot/add-ai-coding-session-dashboard

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

This adds an MVP dashboard for active AI coding sessions across repos/backends, centered on quick recall and fast return to in-flight work. The implementation keeps session tracking out of the UI by introducing a small shared session registry that backend infra updates as terminal sessions start, refresh, and exit.

  • Session model, registry, and dashboard

    • Added ai-code-session.el with a lightweight cl-defstruct, small query/update API, and the dashboard UI:
      • ai-code-session-register
      • ai-code-session-unregister
      • ai-code-session-list
      • ai-code-session-get
      • ai-code-session-update-metadata
      • ai-code-session-refresh
      • ai-code-session-dashboard
    • Tracks core session fields plus extensible metadata (:branch, :status, :dirty-count).
    • Refresh logic derives MVP git/process state without pushing that logic into the dashboard.
  • Dashboard UI

    • Implemented the dashboard in ai-code-session.el using tabulated-list-mode.
    • Renders the MVP columns:
      • Session
      • Repo
      • Task file
      • Backend
      • Branch
      • Status
      • Dirty files
    • Supports the intended first-pass actions:
      • RET switch to session buffer
      • r / g refresh
      • k kill session/buffer
      • D open Magit status for the session repo
    • Shows the available shortcut keys at the bottom of the dashboard window so users can quickly learn the controls in place.
  • Backend infra integration

    • Hooked ai-code-backends-infra.el into the session registry so terminal-backed sessions are registered on create/reuse and unregistered on cleanup/buffer kill.
    • Captures task-file context when a session is started from an AI task file.
    • Keeps the registry synchronized from the existing backend lifecycle rather than adding per-backend tracking code.
  • User entry point

    • Added a new AI CLI session menu entry in ai-code.el:
      • jai-code-session-dashboard
  • Coverage

    • Added focused ERT coverage for:
      • session registration/update/lookup behavior
      • metadata refresh
      • dead-session pruning
      • dashboard rendering
      • dashboard shortcut hint display
      • visit/diff/kill actions
      • edge cases around invalid lookups and session removal

Example session API shape:

(ai-code-session-register
 :buffer (current-buffer)
 :backend "codex"
 :repo-root "/path/to/repo/"
 :task-file "/path/to/repo/.ai.code.files/task_x.org"
 :metadata '(:branch "f1" :status "running" :dirty-count 3))

> [!WARNING]
>
>

Copilot AI linked an issue May 16, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits May 16, 2026 18:36
Copilot AI changed the title [WIP] Add dashboard for AI coding session overview Add MVP AI session dashboard with shared session registry May 16, 2026
Copilot AI requested a review from tninja May 16, 2026 18:46
Copilot finished work on behalf of tninja May 16, 2026 18:46
@tninja
Copy link
Copy Markdown
Owner

tninja commented May 17, 2026

@copilot no need for dedicate ai-code-session-dashboard.el. content should be merged to ai-code-session.el

Copilot AI and others added 2 commits May 17, 2026 00:11
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 17, 2026

@copilot no need for dedicate ai-code-session-dashboard.el. content should be merged to ai-code-session.el

Merged the dashboard implementation into ai-code-session.el and removed the separate ai-code-session-dashboard.el module in ad7ec1c. Updated references/tests accordingly and re-ran the targeted session/menu tests plus the full suite. Screenshot: /tmp/ai-code-session-dashboard-merged.png.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • https://api.github.com/repos/editor-code-assistant/eca/releases/latest
    • Triggering command: /usr/bin/curl /usr/bin/curl -s -f --max-time 5 REDACTED stall-hghw6H/02-dh-elpa-helper_2.0.17ubuntu1_all.deb /usr/bin/apt-config -nxv (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of tninja May 17, 2026 00:13
@tninja
Copy link
Copy Markdown
Owner

tninja commented May 17, 2026

@copilot can we show the shortcut keys in the bottom of the dashboard, so user can easily learn how to use?

Copilot AI and others added 2 commits May 17, 2026 00:44
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 17, 2026

@copilot can we show the shortcut keys in the bottom of the dashboard, so user can easily learn how to use?

Added the shortcut hint at the bottom of the dashboard via the dashboard mode line in b6a67e6, and covered it in the merged session dashboard test. Screenshot: /tmp/ai-code-session-dashboard-footer.png.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • https://api.github.com/repos/editor-code-assistant/eca/releases/latest
    • Triggering command: /usr/bin/curl /usr/bin/curl -s -f --max-time 5 REDACTED (http block)
    • Triggering command: /usr/bin/curl /usr/bin/curl -s -f --max-time 5 REDACTED on -linux-gnu/crti.o (http block)
    • Triggering command: /usr/bin/curl /usr/bin/curl -s -f --max-time 5 REDACTED /tmp/cc8t42E3.o o (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of tninja May 17, 2026 00:48
@tninja tninja marked this pull request as ready for review May 17, 2026 01:18
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59ce42f01f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ai-code-session.el Outdated
(delete-process process))
(when (buffer-live-p buffer)
(kill-buffer buffer))
(ai-code-session-unregister session)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Unregister killed dashboard sessions by ID or buffer

ai-code-session-dashboard-kill-session calls ai-code-session-unregister with the full ai-code-session struct, but ai-code-session-get (used by unregister) only accepts a session ID string or a buffer. That makes this unregister step a no-op, so if kill-buffer is declined or blocked (for example by kill-buffer-query-functions), the session remains registered even though the process was deleted, leaving stale entries in the dashboard.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an MVP AI session dashboard backed by a shared session registry, so users can see and return to active AI CLI sessions across repositories and backends.

Changes:

  • Adds ai-code-session.el with session registration, metadata refresh, dashboard rendering, and dashboard actions.
  • Integrates backend session lifecycle code with the shared registry.
  • Adds a transient menu entry and focused ERT tests for the new dashboard/session APIs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ai-code-session.el Adds the session model, registry API, metadata refresh, and tabulated dashboard UI.
ai-code-backends-infra.el Registers, refreshes, and unregisters terminal-backed AI sessions during lifecycle events.
ai-code.el Adds the dashboard entry to the AI CLI session transient menu and moves the prompt-on-file entry.
test/test_ai-code-session.el Adds tests for registry behavior, dashboard rendering, and dashboard actions.
test/test_ai-code.el Adds a menu test for the new dashboard entry.

Comment thread ai-code-session.el
Comment on lines +200 to +205
(goto-char (point-max))
(unless (bolp)
(insert "\n"))
(insert (propertize ai-code-session-dashboard-shortcuts-hint
'face 'mode-line-inactive))
(insert "\n")))
Comment thread ai-code-session.el Outdated
(delete-process process))
(when (buffer-live-p buffer)
(kill-buffer buffer))
(ai-code-session-unregister session)
Comment thread ai-code-session.el Outdated
(interactive)
(if-let* ((session (ai-code-session-dashboard--session-at-point))
(repo-root (ai-code-session-repo-root session)))
(magit-status-setup-buffer repo-root)
Comment thread ai-code-backends-infra.el
Comment on lines +788 to +792
(ai-code-session-register
:buffer buffer
:backend prefix
:repo-root working-dir
:task-file resolved-task-file))))
@tninja tninja merged commit 48f235f into main May 17, 2026
2 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.

Feat: ai-code-session-dashboard

3 participants