Skip to content

feat: chat shell + handoff archiving + forced color - #35

Merged
liitx merged 3 commits into
mainfrom
feat/chat-shell-and-archive
Jun 18, 2026
Merged

feat: chat shell + handoff archiving + forced color#35
liitx merged 3 commits into
mainfrom
feat/chat-shell-and-archive

Conversation

@liitx

@liitx liitx commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Three commits:

  • forced-color (FORCE_COLOR/NO_COLOR) + status coloring + ⚠️ glyph
  • archive the current handoff before overwriting (setup Start-fresh, suggest overwrite) — snapshot + index
  • conversation-first chat shell (claudart chat): plain text talks to claude w/ context; /flow /suggest invoke

860 tests green, build clean.

liitx added 3 commits June 18, 2026 09:56
- ansi.c honors NO_COLOR / FORCE_COLOR (and CLAUDART_FORCE_COLOR) so surfaces
  that read ANSI but aren't a TTY can show colour; otherwise follows the
  terminal.
- status: colour the Status value by its HandoffStatus hue; branch-mismatch
  warning in yellow.
- StatusBadge.warn uses the ⚠️ emoji glyph for a more visible warning.
New `archiveCurrentHandoff` snapshots the existing handoff to archive/ and
appends an index entry (so `claudart archives` can list/resume it). Wired into
setup "Start fresh" and suggest's overwrite path so starting fresh never
silently loses the prior session. Filename is computed once so the written file
and the index entry always agree.
`claudart chat` greets, resolves the current workspace, then converses: plain
text is a turn answered by `claude` with the session's handoff + skills as
context; slash commands (/flow, /suggest) invoke structured work; /quit exits.
The read->parse->dispatch loop is split out for hermetic testing. Exposes
defaultClaudeRunner so the chat reuses the existing claude call.
Copilot AI review requested due to automatic review settings June 18, 2026 22:23
@liitx
liitx merged commit 3a97d4f into main Jun 18, 2026
@liitx
liitx deleted the feat/chat-shell-and-archive branch June 18, 2026 22:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Not ready to approve

New archiving logic can create noisy/invalid archive index entries (placeholder-only handoffs and multi-line descriptions) and the chat shell currently exits with success on an error path.

Pull request overview

Adds a new conversation-first interactive chat command (claudart chat), improves session safety by archiving the current handoff before overwrites, and refines terminal color/output behavior (forced color env vars + consistent warning glyph/coloring).

Changes:

  • Introduce an interactive chat shell with a “plain text = message, slash = command” parser and hermetic read→parse→dispatch loop.
  • Archive the current handoff (snapshot + index entry) before destructive overwrites (setup start-fresh and suggest overwrite path), with accompanying tests.
  • Add forced-color support via NO_COLOR / FORCE_COLOR and colorize status output + standardize the ⚠️ badge glyph.
File summaries
File Description
test/session/handoff_archive_test.dart New unit tests for handoff snapshot + archive index append behavior.
test/commands/chat_shell_test.dart New tests for chat command parsing and loop dispatch behavior.
lib/ui/render.dart Standardizes warn badge icon to ⚠️.
lib/ui/ansi.dart Adds env-driven color enablement (NO_COLOR/FORCE_COLOR).
lib/session/session_ops.dart Adds archiveCurrentHandoff to snapshot + index the active handoff before overwrites.
lib/pipeline/pipeline_executor.dart Makes the default Claude runner accessible (defaultClaudeRunner) for reuse (e.g. chat shell).
lib/commands/suggest.dart Archives the current handoff before overwriting on re-run suggest confirmation.
lib/commands/status.dart Adds colored status rendering and a colored branch-mismatch warning.
lib/commands/setup.dart Archives the current handoff when choosing “start fresh” and prints the archived filename.
lib/commands/chat_shell.dart New interactive chat shell implementation and command parser.
bin/claudart.dart Registers claudart chat command and documents it in CLI usage text.

Copilot's findings

  • Files reviewed: 10/11 changed files
  • Comments generated: 3

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +100 to +104
print(render.header('CLAUDART'));
if (entry == null) {
print('\n Not in a registered project — run `claudart link` here first.\n');
exit_(0);
}
}
}

const String _commandHint = 'talk to me, or invoke /flow · /suggest · /quit';
Comment on lines +37 to +59
final state = SessionState.parse(content);
final branch = state.branch;
final fileName = archiveName(branch);
final dir = archiveDirFor(workspace);
fileIO.createDir(dir);
fileIO.write(p.join(dir, fileName), content);

appendToIndex(
workspace,
ArchiveEntry(
id: '${branch}_${DateTime.now().millisecondsSinceEpoch}',
kind: kind,
description: state.bug.trim().isEmpty
? (description ?? 'session snapshot')
: state.bug,
branch: branch,
createdAt: DateTime.now(),
handoffFile: fileName,
),
io: fileIO,
);
return fileName;
}
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