Skip to content

[codex] Handle rich ACP prompt content#36

Merged
nick-pape merged 2 commits into
mainfrom
codex/rich-acp-prompt-content
Jun 11, 2026
Merged

[codex] Handle rich ACP prompt content#36
nick-pape merged 2 commits into
mainfrom
codex/rich-acp-prompt-content

Conversation

@nick-pape

Copy link
Copy Markdown
Owner

Summary

  • preserve ACP text, resource link, and image prompt blocks in session logs
  • convert prompt content into deterministic fallback text and AI SDK model content
  • add configurable ACP image prompt capability and update replay/context handling

Closes #10.

Validation

  • node common/scripts/install-run-rush.js build
  • node common/scripts/install-run-rush.js test

@nick-pape nick-pape marked this pull request as ready for review June 11, 2026 05:36
Copilot AI review requested due to automatic review settings June 11, 2026 05:36

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.

Pull request overview

This PR adds first-class handling for rich ACP prompt content (text, resource links, and images) by persisting structured prompt parts in session logs, generating deterministic fallback text renderings, and forwarding image parts to the model when enabled.

Changes:

  • Introduces structured prompt/content types in @fledgling/common and updates context building/token estimation to support structured message content.
  • Adds ACP prompt conversion utilities in agent-core to persist structured content while producing deterministic fallback text + model-ready content.
  • Adds configurable image prompt capability (via env/config) and updates agent replay/session loading to reconstruct rich user history.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
README.md Documents the new image prompt input env toggle and updated rich prompt limitation notes.
packages/context-builder/src/token-estimator.ts Estimates tokens from structured message content by projecting it to fallback text.
packages/context-builder/src/context-builder.test.ts Adds coverage for building replay context from structured user content.
packages/context-builder/src/build-context.ts Converts stored rich user events into model-ready context content with deterministic fallbacks.
packages/common/src/session-events.ts Adds structured content types and extends user message events to persist structured prompt content.
packages/agent-core/src/prompt-content.ts Implements normalization/rendering/model conversion for ACP prompt parts (text/resource_link/image/unsupported).
packages/agent-core/src/prompt-content.test.ts Adds tests for rich prompt conversion, image forwarding behavior, and unsupported blocks.
packages/agent-core/src/interfaces.ts Adds optional prompt content capability flags (imageInput) to dependencies.
packages/agent-core/src/agent.ts Persists structured user content, forwards images when enabled, and advertises prompt image capability.
packages/acp-agent/src/prompt-content.ts Removes legacy prompt flattening utilities (now handled in agent-core).
packages/acp-agent/src/agent.ts Enables image prompt input by default (env-toggleable) in the Node agent dependencies.
packages/acp-agent/src/agent-prompt-cancellation.test.ts Adds tests for prompt capability advertisement, rich prompt persistence, and session reload behavior.
common/reviews/common.public.api.md Updates public API surface for structured message content types.
common/reviews/agent-core.public.api.md Updates public API surface for new prompt conversion utilities and options.

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

Comment thread packages/agent-core/src/prompt-content.ts
Comment thread packages/context-builder/src/build-context.ts Outdated
Comment thread packages/context-builder/src/token-estimator.ts Outdated
Comment thread packages/agent-core/src/prompt-content.ts Outdated
@nick-pape nick-pape merged commit cf93cbe into main Jun 11, 2026
4 checks passed
@nick-pape nick-pape deleted the codex/rich-acp-prompt-content branch June 11, 2026 07:01
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.

Handle rich ACP prompt content instead of flattening to text

2 participants