Skip to content

Chat Create Prompt No Op#669

Merged
arul28 merged 2 commits into
mainfrom
ade/ok-asked-agent-ade-new-9bca8ce0
Jun 30, 2026
Merged

Chat Create Prompt No Op#669
arul28 merged 2 commits into
mainfrom
ade/ok-asked-agent-ade-new-9bca8ce0

Conversation

@arul28

@arul28 arul28 commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Describe the change.

What Changed

Key files and behaviors.

Validation

How you tested.

Risks

Anything to watch.

ADE   Open in ADE  ·  ade/ok-asked-agent-ade-new-9bca8ce0 branch  ·  PR #669

Summary by CodeRabbit

  • New Features

    • Added support for reading chat transcripts from the CLI, including a cleaner formatted output and a --limit option.
    • Added CLI chat messaging improvements, including prompt-based chat creation, kickoff messages, and send/read follow-up workflows.
  • Bug Fixes

    • Improved validation and planning for chat creation so incompatible prompt and no-kickoff options are rejected.
    • Refined chat session output so creation and send actions return clearer, more consistent results.
  • Documentation

    • Expanded CLI and control-plane examples to cover chat creation, transcript reading, and tracked shell sessions.

Greptile Summary

This PR adds --prompt kickoff chaining to ade chat create (creates the session then immediately sends the prompt as the first message), a new ade chat read <session> subcommand, and fixes two issues from the previous review: the --no-kickoff + --prompt conflict guard now covers the --from-linear-issue path as well, and chat.sendMessage now validates the text field before dispatching.

  • cli.ts: buildChatPlan grows a chat read branch that calls chat.readTranscript, a two-step plan for chat create --prompt (session + send), and the buildChatCreateConfigPreview dry-run now renders the full afterCreate sequence (attach + send) so users can verify both steps before launching.
  • registry.ts: explicit readTranscript and sendMessage handlers added to buildChatDomainService, with a getChatTranscript-based fallback for older runtimes that includes client-side since filtering.

Confidence Score: 5/5

Safe to merge — the two previously reported gaps are both addressed, the new code paths are well-tested, and no regressions were found on the existing chat create or linear-issue workflows.

All new code paths have corresponding unit tests, including edge cases (blank text, no-kickoff with linear issue, dry-run preview). The fix to always key the linear-issue attach step as "attach" (instead of conditionally using "result") is correctly reflected in the summarizeExecution handler and verified by test. No untested branches or missing validations were found in the changed files.

No files require special attention. The only comment is on the fallback path in registry.ts where stale pagination metadata may be returned after client-side since-filtering, which is a minor quality improvement rather than a correctness blocker.

Important Files Changed

Filename Overview
apps/ade-cli/src/cli.ts Adds chat read subcommand, --prompt kickoff chaining for chat create, conflict guard for --no-kickoff + --prompt, formatChatRead text formatter, and summarizeExecution branches for the new chat shapes. The attach-step key-change (always attach) fixes a pre-existing labeling bug when --no-kickoff was combined with --from-linear-issue.
apps/desktop/src/main/services/adeActions/registry.ts Registers readTranscript and sendMessage as explicit action handlers on the chat domain service, with input validation, a getChatTranscript fallback, and client-side since filtering in the fallback path. sendMessage now validates the text field, fixing a prior gap.
apps/ade-cli/src/cli.test.ts Comprehensive new tests for kickoff chaining, dry-run preview with afterCreate, --no-kickoff conflict guard on both plain and linear-issue paths, chat read plan construction, transcript formatting, and summarizeExecution output shapes.
apps/desktop/src/main/services/adeActions/registry.test.ts New test coverage for readTranscript (including fallback getChatTranscript path with since-filter), sendMessage validation, and allowlist membership for both new actions.
apps/desktop/resources/agent-skills/ade-cli-control-plane/SKILL.md Documents the Chat-vs-CLI-session distinction, --prompt kickoff semantics, ade chat read, and the ade shell start-cli reasoning-tier path.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant CLI as ade CLI
    participant ADE as ADE Runtime

    Note over User,ADE: ade chat create --prompt "fix tests"
    User->>CLI: chat create --lane L --provider claude --prompt "fix tests"
    CLI->>ADE: chat.createSession(laneId, provider, ...)
    ADE-->>CLI: "{ sessionId: "chat-new" }"
    CLI->>ADE: "chat.sendMessage({ sessionId: "chat-new", text: "fix tests" })"
    ADE-->>CLI: "{ ok: true, accepted: true }"
    CLI-->>User: "{ session: {...}, kickoff: {...} }"

    Note over User,ADE: ade chat read session-id
    User->>CLI: chat read session-id --limit 20 --since ISO
    CLI->>ADE: "chat.readTranscript({ sessionId, limit, since })"
    ADE-->>CLI: "{ entries: [...] }"
    CLI-->>User: formatted transcript

    Note over User,ADE: ade chat create --from-linear-issue ENG-431
    User->>CLI: chat create --from-linear-issue ENG-431
    CLI->>ADE: chat.createSession(...)
    ADE-->>CLI: "{ sessionId: "chat-new" }"
    CLI->>ADE: "lane.attachLinearIssueToSession({ chatSessionId, issues })"
    ADE-->>CLI: "{ linked: true }"
    CLI->>ADE: "chat.sendMessage({ sessionId, text: derivedKickoff })"
    ADE-->>CLI: "{ ok: true, accepted: true }"
    CLI-->>User: "{ session, attach, kickoff }"
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant CLI as ade CLI
    participant ADE as ADE Runtime

    Note over User,ADE: ade chat create --prompt "fix tests"
    User->>CLI: chat create --lane L --provider claude --prompt "fix tests"
    CLI->>ADE: chat.createSession(laneId, provider, ...)
    ADE-->>CLI: "{ sessionId: "chat-new" }"
    CLI->>ADE: "chat.sendMessage({ sessionId: "chat-new", text: "fix tests" })"
    ADE-->>CLI: "{ ok: true, accepted: true }"
    CLI-->>User: "{ session: {...}, kickoff: {...} }"

    Note over User,ADE: ade chat read session-id
    User->>CLI: chat read session-id --limit 20 --since ISO
    CLI->>ADE: "chat.readTranscript({ sessionId, limit, since })"
    ADE-->>CLI: "{ entries: [...] }"
    CLI-->>User: formatted transcript

    Note over User,ADE: ade chat create --from-linear-issue ENG-431
    User->>CLI: chat create --from-linear-issue ENG-431
    CLI->>ADE: chat.createSession(...)
    ADE-->>CLI: "{ sessionId: "chat-new" }"
    CLI->>ADE: "lane.attachLinearIssueToSession({ chatSessionId, issues })"
    ADE-->>CLI: "{ linked: true }"
    CLI->>ADE: "chat.sendMessage({ sessionId, text: derivedKickoff })"
    ADE-->>CLI: "{ ok: true, accepted: true }"
    CLI-->>User: "{ session, attach, kickoff }"
Loading

Reviews (2): Last reviewed commit: "Address chat CLI review feedback" | Re-trigger Greptile

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Jun 30, 2026 12:10am

@arul28

arul28 commented Jun 29, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds chat.readTranscript and chat.sendMessage to the ADE action registry (allowlist, input contracts, domain service). Introduces a ade chat read CLI command with a new chat-read formatter, chains a sendMessage step after chat create --prompt, validates --no-kickoff + --prompt conflict, updates summarizeExecution output shaping, and expands help text, README, and SKILL.md documentation.

Changes

Chat read/send actions and CLI chat read command

Layer / File(s) Summary
Action allowlist, contracts, and domain service
apps/desktop/src/main/services/adeActions/registry.ts
Adds chat.readTranscript to the allowlist, defines input contracts for readTranscript and sendMessage, and implements both in the chat domain service with limit clamping (1–500) and a structured acceptance response for send.
CLI planning: chat read, prompt-kickoff chaining, validation
apps/ade-cli/src/cli.ts
Adds "chat-read" to FormatterId, a new buildChatPlan branch for chat read, rejects --no-kickoff + --prompt, refactors kickoffText, chains a sendMessage step after chat create --prompt, and extends buildChatCreateConfigPreview to emit afterCreate actions.
chat-read formatter and summarizeExecution
apps/ade-cli/src/cli.ts
Introduces formatChatRead for role/timestamp/text rendering, wires it into formatTextOutput, and adds special-case shaping in summarizeExecution for chat create (session/attach/kickoff) and chat send (accepted).
Help text and docs
apps/ade-cli/src/cli.ts, apps/ade-cli/README.md, apps/desktop/resources/agent-skills/ade-cli-control-plane/SKILL.md
Updates CLI help examples and flags (including ultracode tier, --kickoff alias, CLI sessions section), README command examples, and adds a "Chat vs. CLI sessions" section to SKILL.md.
Tests
apps/ade-cli/src/cli.test.ts, apps/desktop/src/main/services/adeActions/registry.test.ts
Adds expectStaticPlan helper, refactors typed plan assertions, and adds tests for prompt chaining, --print-config afterCreate preview, chat read planning, --no-kickoff+--prompt rejection, chat-read formatter output, summarizeExecution kickoff shaping, help strings, and registry contract/normalization for readTranscript and sendMessage.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

Possibly related PRs

  • arul28/ADE#361: Both PRs touch agentChatService.readTranscript semantics (limit/since) and the chat transcript pathway that this PR now exposes via chat.readTranscript.

Suggested labels

desktop

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title hints at a chat create prompt issue, but it is too vague to clearly summarize the broader CLI and chat transcript changes. Use a clearer title that names the main change, such as adding chat create prompt kickoff behavior and chat read/send support.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/ok-asked-agent-ade-new-9bca8ce0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mintlify

mintlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ade-ac1c6011 🟢 Ready View Preview Jun 29, 2026, 11:50 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@arul28 arul28 force-pushed the ade/ok-asked-agent-ade-new-9bca8ce0 branch from 09d816a to f36e8bb Compare June 29, 2026 23:50
@arul28

arul28 commented Jun 29, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/ade-cli/src/cli.test.ts (1)

1051-1484: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Add transport-specific coverage for these chat flows
apps/ade-cli/src/cli.test.ts:1051-1484 only exercises planning/formatting and a headless stub; add one headless and one desktop-socket-backed test for chat create --prompt and chat read so dispatch/envelope mismatches in either mode are caught.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/ade-cli/src/cli.test.ts` around lines 1051 - 1484, Add
transport-specific coverage for the chat flows by extending cli.test.ts with one
headless and one desktop-socket-backed test for chat create --prompt and chat
read. Reuse buildCliPlan, expectExecutePlan, expectStaticPlan,
summarizeExecution, and the chat create/read assertions already in this block,
but run them through both transport modes so dispatch and envelope differences
are verified in executePlan and summarizeExecution. Ensure the new tests cover
the createSession/sendMessage chaining and readTranscript envelope in both
headless and desktop socket paths.

Source: Coding guidelines

🧹 Nitpick comments (1)
apps/ade-cli/src/cli.test.ts (1)

1250-1263: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the other kickoff aliases in this rejection test.

buildChatPlan(...) rejects --no-kickoff with --prompt, --kickoff, and --kickoff-prompt, but this assertion only locks down the --prompt spelling. A small table-driven test here would catch alias regressions too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/ade-cli/src/cli.test.ts` around lines 1250 - 1263, The rejection test
for conflicting kickoff flags only covers the --prompt case, so it does not
protect the other aliases handled by buildChatPlan. Update the test around
buildCliPlan/buildChatPlan to be table-driven and verify that --no-kickoff is
rejected with --prompt, --kickoff, and --kickoff-prompt, using the same conflict
assertion pattern for each variant.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/ade-cli/src/cli.ts`:
- Around line 3606-3621: The dry-run preview for the Linear attach step is
missing the attachment flags that the real flow passes through. Update the
`preview`/`afterCreate` construction in `cli.ts` so the
`lane.attachLinearIssueToSession` entry includes the same `attachmentFlags` data
produced by `readLinearAttachmentFlags(args)` and spread in the live path,
keeping the `compactPreviewObject` shape aligned with the actual `afterCreate`
payload.
- Around line 5889-5891: The `chat create` validation only blocks `--no-kickoff`
for plain chat create, but the same no-op prompt path can happen when
`--from-linear-issue` is used with explicit prompt aliases. Update the guard
around `explicitKickoff` in `cli.ts` so `--no-kickoff` is rejected whenever any
explicit prompt is provided, including Linear issue chat create, and keep the
error handling centralized in the same `CliUsageError` branch.
- Around line 15230-15231: The mapping in cli.ts is incorrectly renaming the
attach response from values.result to kickoff, which breaks the no-kickoff
Linear issue flow. Update the object assembly around unwrapActionEnvelope so the
attach step stays keyed as attach even when kickoff is skipped, or derive the
key from the action type before assigning it. Use the existing values.attach and
values.result branches to ensure the summary preserves the correct action name.
- Around line 5741-5762: The chat action path handled in cli.ts for sub values
like read/messages/transcript needs test coverage in both execution modes. Add
or extend tests around the CLI action builder so that chat.readTranscript and
the chained chat.sendMessage flow are exercised once through the headless
runtime and once through the desktop socket-backed RPC path, using the existing
actionStep and chat read/sendMessage symbols to locate the logic.

In `@apps/desktop/src/main/services/adeActions/registry.test.ts`:
- Around line 83-85: The ADE registry test coverage is missing the allowlist
check for the new chat send action. Update the assertions in registry.test.ts
near isAllowedAdeAction/isCtoOnlyAdeAction to include a direct expectation that
isAllowedAdeAction("chat", "sendMessage") is true, so the
ADE_ACTION_ALLOWLIST.chat.sendMessage path is verified alongside the existing
transcript checks.

In `@apps/desktop/src/main/services/adeActions/registry.ts`:
- Around line 1106-1116: `chat.sendMessage` is forwarding the parsed payload
without enforcing the required `text` contract at the action boundary. In
`sendMessage`, after `readObjectActionArg` and `requireNonEmptyString` for
`sessionId`, also validate `record.text` with `requireNonEmptyString` before
calling `agentChatService.sendMessage`. Keep the validation in the same action
handler so whitespace-only or missing text is rejected early, and continue
passing the normalized `sessionId` and validated `text` into
`agentChatService.sendMessage`.

---

Outside diff comments:
In `@apps/ade-cli/src/cli.test.ts`:
- Around line 1051-1484: Add transport-specific coverage for the chat flows by
extending cli.test.ts with one headless and one desktop-socket-backed test for
chat create --prompt and chat read. Reuse buildCliPlan, expectExecutePlan,
expectStaticPlan, summarizeExecution, and the chat create/read assertions
already in this block, but run them through both transport modes so dispatch and
envelope differences are verified in executePlan and summarizeExecution. Ensure
the new tests cover the createSession/sendMessage chaining and readTranscript
envelope in both headless and desktop socket paths.

---

Nitpick comments:
In `@apps/ade-cli/src/cli.test.ts`:
- Around line 1250-1263: The rejection test for conflicting kickoff flags only
covers the --prompt case, so it does not protect the other aliases handled by
buildChatPlan. Update the test around buildCliPlan/buildChatPlan to be
table-driven and verify that --no-kickoff is rejected with --prompt, --kickoff,
and --kickoff-prompt, using the same conflict assertion pattern for each
variant.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 052b7999-e558-4b00-8e4a-7adf69ef6aa8

📥 Commits

Reviewing files that changed from the base of the PR and between 21f97b6 and 09d816a.

⛔ Files ignored due to path filters (3)
  • docs/ARCHITECTURE.md is excluded by !docs/**
  • docs/features/agents/README.md is excluded by !docs/**
  • docs/features/chat/README.md is excluded by !docs/**
📒 Files selected for processing (6)
  • apps/ade-cli/README.md
  • apps/ade-cli/src/cli.test.ts
  • apps/ade-cli/src/cli.ts
  • apps/desktop/resources/agent-skills/ade-cli-control-plane/SKILL.md
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts

Comment thread apps/ade-cli/src/cli.ts
Comment thread apps/ade-cli/src/cli.ts
Comment thread apps/ade-cli/src/cli.ts Outdated
Comment thread apps/ade-cli/src/cli.ts
Comment thread apps/desktop/src/main/services/adeActions/registry.test.ts
Comment thread apps/desktop/src/main/services/adeActions/registry.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f36e8bb375

ℹ️ 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".

const since = typeof record.since === "string" && record.since.trim()
? record.since.trim()
: undefined;
return agentChatService.readTranscript(sessionId, limit, since);

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 Add a headless fallback for chat transcript reads

When the CLI falls back to its in-process headless runtime, agentChatService does not implement readTranscript; it exposes getChatTranscript instead (apps/ade-cli/src/headlessLinearServices.ts:1686). Because this wrapper is always added and calls agentChatService.readTranscript(...) unconditionally, ade chat read ... / chat.readTranscript now fail with a TypeError whenever no desktop/runtime socket is available, even though the new command is not marked socket-only. Guard this call or map to the headless transcript API.

Useful? React with 👍 / 👎.

Comment thread apps/desktop/src/main/services/adeActions/registry.ts Outdated
Comment thread apps/ade-cli/src/cli.ts Outdated
@arul28

arul28 commented Jun 30, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: be3c55445d

ℹ️ 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".

@arul28 arul28 merged commit 64b198d into main Jun 30, 2026
27 checks passed
@arul28 arul28 deleted the ade/ok-asked-agent-ade-new-9bca8ce0 branch June 30, 2026 00:36
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.

1 participant