Skip to content

feat(cli): Add local agent chat#593

Merged
dcramer merged 20 commits into
mainfrom
feat/local-agent-cli
Jun 11, 2026
Merged

feat(cli): Add local agent chat#593
dcramer merged 20 commits into
mainfrom
feat/local-agent-cli

Conversation

@dcramer

@dcramer dcramer commented Jun 11, 2026

Copy link
Copy Markdown
Member

Junior can now run real agent turns from the terminal with junior chat: -p exits after one message, interactive mode keeps one process-scoped conversation, and local chat defaults to memory unless JUNIOR_STATE_ADAPTER is explicitly selected. That keeps ordinary local QA from inheriting Redis just because .env.local contains REDIS_URL, while still allowing durable state to be opted into deliberately.

This also tightens platform boundaries for future non-Slack ingress. Source/requestor context is generic through the shared agent path, Slack tool runtime context is derived only inside Slack-specific tools, and scheduler/plugin dispatch records keep Slack-only destinations where the feature is Slack-only. apps/example is now documented as the local QA fixture through the new junior-qa agent skill, with specs and focused tests covering the local-vs-Slack contracts.

Add a local Junior chat command and runner so agent turns can be exercised without Slack. The local path uses a first-class local destination, stable workspace-scoped conversation ids, and the shared reply generator while keeping plugin dispatch and scheduler surfaces Slack-only.

Document the local flow in specs and public CLI docs, and cover the CLI, destination contract, local conversation ids, local runner, and dispatch narrowing with focused tests.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 11, 2026 8:15pm

Request Review

Comment thread packages/junior/src/chat/local/runner.ts Outdated
Comment thread packages/junior/src/cli/chat.ts Outdated
Keep interactive local chat sessions open after ordinary turn failures, while still treating terminal output failures as delivery errors. Require an explicit local delivery port before the runner can commit assistant state.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Comment thread packages/junior/src/cli/chat.ts Outdated
Comment thread packages/junior/src/chat/local/runner.ts
Comment thread packages/junior/src/chat/local/runner.ts Outdated
Comment thread packages/junior/bin/junior.mjs
Allow --once messages to contain flag-like text and load durable Pi projection for local turns. Keep delivered local replies out of the failed-turn path if final state persistence fails after terminal delivery.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Comment thread packages/junior/src/cli/chat.ts Outdated
Comment thread packages/junior/src/chat/local/runner.ts
Comment thread packages/junior/src/chat/local/conversation.ts
Reject local file replies until local file output exists, keep local conversation ids out of Slack thread correlation, and allow --conversation to appear after --once message text. Update the local specs and docs to match the implemented contracts.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Comment thread packages/junior/src/chat/local/runner.ts Outdated
Reset the local Pi projection to the pre-run state when terminal delivery fails after generation. This keeps durable local follow-up history aligned with the visible delivery contract.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Comment thread packages/junior/src/chat/local/runner.ts Outdated
Rollback local artifacts, sandbox metadata, and Pi projection when generation succeeds but terminal delivery fails. This keeps durable follow-up state aligned with the visible local delivery contract.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
dcramer and others added 2 commits June 10, 2026 21:58
Force the CLI entrypoints to exit with the dispatcher result code after a command completes. This keeps one-shot local chat validation from hanging on provider or tracing handles after delivery succeeds.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Document the local agent as the first manual behavior check for non-Slack-specific changes. Link the runbook from the CLI docs, testing docs, sidebar, and AGENTS.md so contributors and coding agents use the same workflow.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Document apps/example as the canonical local validation app for monorepo work. Add concrete local agent checks for the app-local skill and plugin-bundled example skill.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Narrow the local agent validation runbook to environment-backed credential checks. User-bound OAuth and credential issuance flows still require Slack or deployed OAuth validation because local chat runs as the local-cli system actor with authorization prompts disabled.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Clarify that the first local CLI path uses a direct local runner rather than durable inbound-message mailbox records. Keep mailbox-backed local source routing as the future platform-ingress contract.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Validate local conversation ids before the runner crosses into shared reply generation. Keep the CLI delivery port on a local reply projection and return only the local outcome from the runner.

Align the chat architecture spec with the first-pass direct local runner path.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Strip Node's leading argv separator before dispatching CLI commands while preserving command-level flags.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Comment thread packages/junior/src/chat/local/runner.ts
Carry the finalized Pi transcript on assistant replies so the local runner can commit it only after local delivery succeeds. Persist the same messages into local conversation state for the legacy fallback path.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Use -p for one-shot local prompts and create a fresh local conversation for every CLI invocation. Keep multi-turn continuity scoped to the running interactive process instead of exposing named local conversations.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Remove stale named-conversation and default-history surfaces from the local chat CLI. Strengthen tests so prompt invocations use fresh conversations while interactive prompts share one process-scoped conversation.

Co-Authored-By: GPT-5 Codex <codex@openai.com>

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2d435e4. Configure here.

Comment thread packages/junior/src/chat/local/runner.ts
Use conversation Pi history when the session-log projection is stale for a local turn. This keeps follow-up local prompts aligned with the newest persisted conversation state if session-log commit fails after delivery state persists.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Make local and Slack agent turns share the core reply path through explicit destination and requester contracts. Move Slack-only plugin hook data under ctx.slack and derive Slack tool context from the typed destination.

Update specs, generated API docs, and focused tests for the stronger local-vs-Slack boundary.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Move Slack-specific tool state behind a SlackToolContext derived from the typed destination and requester. Keep local tool contexts free of Slack hints while preserving runtime-owned Slack delivery metadata for Slack turns.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Make local chat default to memory unless a state adapter is selected explicitly, so REDIS_URL in the repo environment does not couple local QA to Redis.

Carry source/requestor context through shared agent and plugin tool paths while keeping Slack-specific context inside Slack tool boundaries. Add the junior-qa agent skill to document local CLI QA through apps/example.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@dcramer dcramer merged commit fe21b74 into main Jun 11, 2026
16 checks passed
@dcramer dcramer deleted the feat/local-agent-cli branch June 11, 2026 20:21
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