Skip to content

Show completed agent work without reopening the full thread#2941

Open
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:agent/job-result-handoff
Open

Show completed agent work without reopening the full thread#2941
BradGroux wants to merge 1 commit into
block:mainfrom
BradGroux:agent/job-result-handoff

Conversation

@BradGroux

Copy link
Copy Markdown

Closes #2932.

Observed problem

Buzz already has signed agent job events, but kind:43004 results are opaque strings. A requester has to reconstruct the requested outcome, final state, artifacts, verification, and blockers from the full thread, and Home can expose structured content as raw JSON.

No competing open pull request was found for this result-handoff scope.

Cause

KIND_JOB_RESULT had no payload contract, SDK builder, or CLI publisher. Desktop routed every result through the generic Markdown renderer, and Home knew only the event kind.

What changes

  • Adds a versioned JobResultPayload contract in buzz-core, including dispositions, typed artifact references, verification results, explicit blockers, byte and item limits, unsafe-reference rejection, and cross-field invariants.
  • Adds a typed buzz-sdk builder that emits one channel tag, one direct job-request reply tag, schema and disposition hints, and canonical signed JSON content.
  • Adds buzz jobs handoff --channel <uuid> --job <event-id> --manifest <path|-> with file and stdin input, pre-signing validation, job-reference matching, and the standard normalized write response.
  • Adds a Desktop handoff card that separates outcome, requested outcome, progress, blocker, artifacts, verification, and disposition.
  • Adds a human-readable Home projection and reserves realistic virtualized row height for structured cards.
  • Keeps legacy, malformed, unsupported, oversized, or tag-mismatched 43004 content on the existing Markdown fallback.
  • Documents the protocol and privacy boundary in docs/nips/NIP-AJ.md.

Trust and compatibility

The signed content is authoritative, while schema and disposition tags are query hints. Desktop only trusts structured content when the payload event ID matches the single signed reply tag. Producers never scan a working directory or infer local file contents, credentials, environment variables, or verification.

Version 1 ignores additive unknown object fields. Older clients continue to see JSON content as ordinary text, and newer clients continue to render legacy plaintext results as Markdown.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p buzz-core -p buzz-sdk -p buzz-cli — 736 tests passed across the affected Rust packages, plus doc tests.
  • pnpm --dir desktop test — 3,531 tests passed.
  • pnpm --dir desktop typecheck
  • pnpm --dir desktop build:e2e
  • Targeted Biome check over every changed Desktop file.
  • Dark-theme Playwright render inspected at 1280×900; screenshot will be attached in a follow-up comment.

just ci reaches the Desktop file-size gate and stops on desktop/src-tauri/src/managed_agents/runtime.rs: the checker reports 2,220 lines against a 2,216-line limit. That file is byte-for-byte unchanged from origin/main; this pull request does not modify or exempt it.

The SDK signing test round-trips the canonical payload through the signed event shape, and the CLI submits through the existing relay event path. A live relay integration run was not performed in this worktree because the repository gate stopped before integration on the unrelated base violation above.

Review findings resolved before publication

  • Desktop originally validated the payload without confirming that jobRequest matched the signed reply tag. Structured rendering now requires exactly one valid reply tag and an exact event-ID match.
  • Desktop originally did not enforce the 64 KiB content limit before parsing. Oversized structured content now fails closed to the legacy renderer.
  • Artifact URLs containing credentials, absolute or traversing file paths, duplicate React keys, and dark-theme status contrast were tightened during review.

Non-goals

  • No scheduler, worker loop, approval system, project-management surface, or local workspace scanner.
  • No change to job acceptance or agent mention delivery.
  • No new HTTP endpoint or production dependency.

Co-authored-by: Brad Groux <bradgroux@hotmail.com>
Signed-off-by: Brad Groux <bradgroux@hotmail.com>
@BradGroux
BradGroux requested a review from a team as a code owner July 26, 2026 04:21
@BradGroux

Copy link
Copy Markdown
Author

Result handoff card

The same signed kind:43004 payload renders with distinct outcome, progress, artifact, verification, and disposition fields in both supported themes.

Light theme

Agent result handoff card in the light theme

Dark theme

Agent result handoff card in the dark theme

@BradGroux BradGroux changed the title feat(jobs): add inspectable agent result handoffs Show completed agent work without reopening the full thread Jul 26, 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.

Make completed agent work inspectable without reading the full thread

1 participant