fix: rewrite agents to the real runtime VFS API

Merged
KH
5mo ago
+282-100

These agents used a ctx.<provider> client API (ctx.linear.createIssue, ctx.github.comment, ctx.slack.post, โ€ฆ) that does not exist on WorkforceCtx โ€” 33 TS2339 errors, and the if (!ctx.linear) throw guards would have thrown at runtime, so the agents were never functional.

Rewrote all 7 to the real @agentworkforce/runtime VFS API (writeJsonFile/readJsonFile/draftFile/encodeSegment/resolveMountRoot), using the canonical adapter VFS paths and writeback receipts โ€” modeled on examples/{review-agent,linear-shipper,notion-essay-pr}. Control flow and the real ctx.harness/llm/files/sandbox/memory/log usage are preserved.

tsc --noEmit is clean (0 errors); no ctx.<provider> references remain.

๐Ÿค– Generated with Claude Code


Summary by cubic

Rewrote all seven agents to use the real @agentworkforce/runtime VFS API instead of non-existent ctx.<provider> calls, fixing 33 TS errors and runtime crashes. Agents now interact with GitHub, Linear, Slack, and Notion via Relayfile and are functional.

  • Bug Fixes

    • Replaced invalid ctx.github/ctx.linear/ctx.slack/ctx.notion calls with VFS helpers (writeJsonFile, readJsonFile, draftFile, encodeSegment, resolveMountRoot).
    • Handled writeback receipts for issue URLs/IDs, PR merges, and Notion page URLs; log warnings when receipts are missing.
    • Removed throwing integration guards; tsc is clean (0 errors).
  • Refactors

    • Standardized canonical VFS paths for GitHub (PR meta/comments/merge), Linear (issues/comments), Slack (channels/users), and Notion (database pages).
    • Added a vfsClient() helper to supply relayfileMountRoot.
    • Preserved existing control flow and ctx.harness/llm/files/sandbox/memory/log usage.