Skip to content

Add report_dreaming_artifact tool to engine-tools MCP server#20

Draft
dario-nunez wants to merge 1 commit into
mainfrom
dario-nunez/dreaming-artifact-tool
Draft

Add report_dreaming_artifact tool to engine-tools MCP server#20
dario-nunez wants to merge 1 commit into
mainfrom
dario-nunez/dreaming-artifact-tool

Conversation

@dario-nunez

Copy link
Copy Markdown
Member

What

Adds a report_dreaming_artifact tool to the engine-tools MCP server so Dreaming jobs can report a generated artifact back to the platform.

Implements the SDK piece of github/agents issue 1476 (Dreaming M0: add Dreaming artifact reporting tool).

Why

Dream jobs (e.g. memory-voting) produce an artifact that needs to reach the platform. MCP tools do not have the engine job-progress token, so the tool hands the artifact to PlatformClient, which already holds the token and nonce and posts to the job-progress endpoint. The token never reaches the model.

Changes

  • client.ts
    • DreamingArtifact type (title, summary, optional data).
    • DREAMING_PROGRESS_NAMESPACE = "dreaming", DREAMING_ARTIFACT_KIND = "artifact", DREAMING_ARTIFACT_VERSION = 0.
    • PlatformClient.sendDreamingArtifact() posts a progress payload on the first-party dreaming namespace (deliberately not the default sessions-v2), so downstream consumers can filter on it.
  • mcp-server.ts
    • Registers report_dreaming_artifact, mirroring the existing reply_to_comment tool.
    • Guards on config.platformClient and enforces MAX_DREAMING_ARTIFACT_CONTENT_BYTES (256 KiB) before sending, so oversized artifacts are rejected up front rather than failing on the downstream hydro topic.
  • index.ts
    • Exports the new public symbols.

Provisional decisions (M0)

These three items from the issue are resolved here with reasonable defaults and may change:

  • Tool name: report_dreaming_artifact
  • Payload schema: { title, summary, data? }
  • Size limit: 256 KiB of serialized artifact content

Verification

  • npm run build (typecheck + esbuild bundle) passes.
  • Local end-to-end smoke test (not committed) against the built dist, using the MCP in-memory transport and a stubbed fetch, confirms:
    • the tool is registered and exposes the title + summary input schema;
    • a small artifact triggers exactly one POST to jobs/{jobId}/progress with namespace: "dreaming", kind: "artifact", version: 0, the auth bearer + job-nonce headers, and content round-tripping the artifact;
    • an oversized artifact returns isError and issues no HTTP call.

This repo has no test runner, so no automated tests were added.

Follow-ups (out of scope here)

  • sweagentd must add the dreaming progress namespace to its emit list so the payload is forwarded to hydro.
  • The copilot-dreams memory-voting task must list report_dreaming_artifact in its tools and prompt for it.
  • The hydro consumer + storage that persists the artifact is separate future work.

Adds a report_dreaming_artifact MCP tool so dream jobs can hand a
generated artifact back to the platform over the existing job-progress
channel, without exposing the engine token to the model.

- client.ts: DreamingArtifact type, DREAMING_* progress constants, and
  PlatformClient.sendDreamingArtifact() which posts on the first-party
  "dreaming" progress namespace (not the default sessions-v2 namespace).
- mcp-server.ts: register report_dreaming_artifact, mirroring
  reply_to_comment; guards on platformClient and enforces a
  MAX_DREAMING_ARTIFACT_CONTENT_BYTES size cap before sending.
- index.ts: export the new public symbols.

Tool name, payload schema, and size limit are provisional M0 defaults
(github/agents issue 1476) and may change once finalized.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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