Skip to content

feat(agents): add Publish action, overview summary; drop "Explain this agent"#2884

Closed
dmarticus wants to merge 2 commits into
mainfrom
ruby-feedback
Closed

feat(agents): add Publish action, overview summary; drop "Explain this agent"#2884
dmarticus wants to merge 2 commits into
mainfrom
ruby-feedback

Conversation

@dmarticus

Copy link
Copy Markdown
Contributor

Summary

User feedback flagged three coupled problems with the agent-applications UI:

  • Every visit to an agent's Overview was paying an LLM tax — the "Explain this agent" header button seeded "Explain what this agent does and how it's configured" against the meta-agent on every click for what should be static metadata.
  • The Draft badge in the header had no matching action — publishing required digging into the revision dropdown's two-step "Freeze → Promote to live".
  • The Overview tab itself was shallow — just KPIs and recent sessions, nothing about what the agent does.

This PR:

  • Drops "Explain this agent" from headerActionForPage + the matching starter suggestion.
  • Adds set_application_description as a new agent-builder client tool. The meta-agent writes a short summary (capped at 280 chars, trimmed, rejected on overflow) to AgentApplication.description via a new updateAgentApplication PATCH on the API client. Cache invalidation flips the header / list / overview.
  • Adds an Overview "About this agent" section — renders description (or a quiet "agent-builder will write one" fallback) above a compact stat-tile row counting triggers (with type breakdown), tools, skills, MCPs, identities. Sources the live revision's spec via the existing useAgentRevision hook, falling back to the newest revision when nothing is live yet.
  • Adds a header <PublishButton /> on the agent page. Hidden when archived, disabled when no draft. One-click confirm → sequential freeze then promote (atomic per action server-side, so no refetch between them).

Open follow-up

The deployed agent-builder meta-agent's server-side system prompt still needs to be told about set_application_description so it actually invokes the tool. That lives outside this repo. Until that prompt update lands, the new Overview will keep rendering the "No description yet — the agent-builder will write one" fallback for fresh agents.

Test plan

  • pnpm vitest run agent-applications — 9 new cases pass (4 PublishButton helper, 5 client-tool branches: happy path, missing agent_slug, missing description, over-cap length, update failure)
  • pnpm lint — clean
  • pnpm --filter @posthog/ui typecheck / pnpm --filter @posthog/api-client typecheck — clean in touched files (preexisting errors in canvas/ChannelsList, canvas/WebsiteLayout, code-review/InteractiveFileDiff, shell/posthogAnalyticsImpl are unrelated to this PR)
  • node scripts/check-host-boundaries.mjs — no new violations
  • Smoke against live app (CDP :9222):
    • Agent overview with a draft revision → header shows Publish (not "Explain this agent") → click → confirm → Draft badge flips to Live
    • Agent overview without a draft → Publish is disabled
    • "About this agent" stat tiles match the Configuration tab's content
    • Agent-builder dock calls set_application_description after the server-side prompt is updated

🤖 Generated with Claude Code

…s agent"

The agent builder header was paying an LLM tax: every visit to an agent's
overview seeded a fresh "Explain what this agent does" prompt against the
meta-agent. Treat the agent's `description` as the source of truth instead —
the agent-builder writes it via a new `set_application_description` client
tool, the Overview renders it inline above a compact map of triggers/tools/
skills/MCPs/identities, and the header now hosts a one-click Publish that
freezes-then-promotes the latest draft behind a single confirm.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

React Doctor found 3 issues in 2 files · 3 warnings.

3 warnings

src/features/agent-applications/components/AgentApplicationDetailView.tsx

src/features/agent-applications/components/PublishButton.tsx

Reviewed by React Doctor for commit ee18e77.

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(agents): add Publish action, overvi..." | Re-trigger Greptile

Comment thread packages/ui/src/features/agent-applications/hooks/useUpdateAgentApplication.ts Outdated
The hook was added in this PR but never imported — the agent-builder
client tool calls client.updateAgentApplication and invalidates the same
caches inline. Delete the unreachable wrapper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dmarticus dmarticus marked this pull request as ready for review June 26, 2026 04:48
@dmarticus dmarticus requested a review from a team June 26, 2026 04:49
@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "chore(agents): drop unused useUpdateAgen..." | Re-trigger Greptile

"Help me create a new agent — walk me through what it should do, then set it up.",
agentSlug: null,
};
case "agent":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not?

};
}
try {
await client.updateAgentApplication(agentSlug, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is bizarre - why are we making the agent only able to do this in the console? This should just be soemthing it knows how to do via the mcp surely?

@dmarticus

Copy link
Copy Markdown
Contributor Author

in hindsight, this was directionally incorrect. closing.

@dmarticus dmarticus closed this Jun 30, 2026
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