Skip to content

Add Markdown custom agent selection - #170

Merged
cnjack merged 3 commits into
mainfrom
codex/custom-agent-markdown-selector
Jul 24, 2026
Merged

Add Markdown custom agent selection#170
cnjack merged 3 commits into
mainfrom
codex/custom-agent-markdown-selector

Conversation

@cnjack

@cnjack cnjack commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What changed

  • replace unused JSON custom-agent definitions with layered *.agent.md files under ~/.jcode/agents/ and <project>/.jcode/agents/
  • require name and description frontmatter plus a non-empty Markdown instruction body; support an optional role model
  • apply deterministic duplicate handling: first valid filename in a layer wins, and project roles override user roles
  • use the same effective role for top-level sessions and delegated subagents, workflows, and team members
  • add jcode --agent, a conditional Web/Desktop Agent picker, active-agent display, localized switch notices, and session persistence/replay
  • keep ACP on Default for new sessions while restoring a saved custom role on load/resume
  • add internal and published documentation plus loader, session, API, UI, routing, and compatibility tests

Why

Custom agents already existed as an unused JSON-only delegated-role mechanism, but there was no top-level selection or visible current-agent state. The new Markdown format matches the repository's instruction-oriented workflows and follows the useful Codex/Grok semantics: role instructions are reusable, an optional role model can override selection, and runtime permissions remain inherited from the caller.

User/developer impact

When valid custom agents exist, Web/Desktop shows Default plus every effective role. CLI users can select one with jcode --agent <name>. Agent changes survive resume and appear in the timeline. Custom Markdown cannot add tools, bypass approval, or broaden the active mode/sandbox.

This intentionally removes inline/legacy JSON agent definitions; the feature was not yet in use.

Validation

  • go test ./...
  • go test -race ./internal/config ./internal/session ./internal/web ./internal/command
  • make lint
  • make build
  • pnpm --dir packages/jcode-ui test
  • pnpm --dir web test
  • pnpm --dir site build
  • pre-push hook: Go build, vet, golangci-lint, and full Go test suite

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@cnjack, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 45774ccd-1a0f-4a9f-a638-64ade31b8db1

📥 Commits

Reviewing files that changed from the base of the PR and between 7fd8fb4 and f63ce14.

📒 Files selected for processing (55)
  • cmd/jcode/main.go
  • go.mod
  • internal-doc/custom-agents.md
  • internal/command/acp.go
  • internal/command/custom_agents.go
  • internal/command/custom_agents_test.go
  • internal/command/interactive.go
  • internal/command/web.go
  • internal/config/agent_roles.go
  • internal/config/agent_roles_test.go
  • internal/config/config.go
  • internal/session/agent_roundtrip_test.go
  • internal/session/history.go
  • internal/session/session.go
  • internal/team/manager.go
  • internal/tools/flow_spawn.go
  • internal/tools/subagent.go
  • internal/tools/subagent_model_routing_test.go
  • internal/tools/subagent_test.go
  • internal/tools/team_tools.go
  • internal/tools/team_tools_test.go
  • internal/tui/messages.go
  • internal/tui/session_helper.go
  • internal/tui/session_helper_test.go
  • internal/tui/update.go
  • internal/web/agents.go
  • internal/web/agents_test.go
  • internal/web/chat.go
  • internal/web/engine.go
  • internal/web/server.go
  • internal/web/sessions.go
  • packages/jcode-ui/src/product/ChatInput.test.tsx
  • packages/jcode-ui/src/product/ChatInput.tsx
  • packages/jcode-ui/src/product/host.ts
  • packages/jcode-ui/src/product/index.ts
  • packages/jcode-ui/src/product/strings.ts
  • packages/jcode-ui/src/product/types.ts
  • packages/jcode-ui/src/styles/composer2.css
  • site/docs/overview/custom-agents.md
  • web/src/App.tsx
  • web/src/app/composerHost.ts
  • web/src/app/store.ts
  • web/src/app/wsBridge.ts
  • web/src/components/AuthGate.tsx
  • web/src/components/ChatView.tsx
  • web/src/components/CommandPalette.tsx
  • web/src/components/SetupView.tsx
  • web/src/i18n/locales/en.ts
  • web/src/i18n/locales/ja.ts
  • web/src/i18n/locales/ko.ts
  • web/src/i18n/locales/zh-Hans.ts
  • web/src/i18n/locales/zh-Hant.ts
  • web/src/lib/api.ts
  • web/src/lib/types.ts
  • web/src/lib/ws.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/custom-agent-markdown-selector

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.

cnjack added 2 commits July 24, 2026 20:03
- Remove conditional primary-color highlight from effort/agent picker
  triggers and agent list items; use uniform foreground color
- Only show agent-changed system notice when a conversation is active
  (timeline non-empty) to avoid replacing the welcome hero
@cnjack
cnjack marked this pull request as ready for review July 24, 2026 15:21
@cnjack
cnjack merged commit 35e4fbd into main Jul 24, 2026
4 checks passed
@cnjack
cnjack deleted the codex/custom-agent-markdown-selector branch July 24, 2026 15:22
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