Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

The custom agent guide referenced an outdated architecture where safe outputs used individual jobs (buildCreateOutputIssueJob), but the codebase now uses a handler manager that dispatches messages to factory functions within a consolidated job.

Changes

Step 7: Handler Implementation

  • Document handler factory pattern: main(config) returns a message processing function
  • Add closure-based state management for handler instances
  • Include TypeScript type references and available helper modules

Step 10: Handler Manager Integration

  • Replace standalone job builder pattern with dispatcher architecture
  • Document integration points:
    • Config type definition and parsing in Go
    • Handler registration in HANDLER_MAP
    • Config generation in addHandlerManagerConfigEnvVar()
    • Consolidated job integration via hasHandlerManagerTypes
  • Include standalone step alternative for cases requiring pre/post operations

Success Criteria & Pitfalls

  • Add handler-specific validation items (factory returns function, HANDLER_MAP registration)
  • Update references to current file locations (actions/setup/js/ vs pkg/workflow/js/)

Architecture

// Handler factory pattern
async function main(config = {}) {
  const maxCount = config.max || 10;
  let processedCount = 0;
  
  return async function handleMessage(message, resolvedTemporaryIds) {
    if (processedCount >= maxCount) {
      return { success: false, error: `Max count reached` };
    }
    processedCount++;
    // Process message...
    return { success: true, temporaryId: message.temporary_id };
  };
}

The handler manager loads factories once, then dispatches messages to the returned handlers, enabling shared state and centralized temporary ID resolution across all safe output types.

Original prompt

Update the plan in "create safe output type" custom agent.md file to use the safe output handler manager architecture (like create_issue) rather than standalone step.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 5, 2026 19:34
…chitecture

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…agent guide

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update plan in create safe output type custom agent Update create-safe-output-type custom agent to document handler manager architecture Jan 5, 2026
Copilot AI requested a review from pelikhan January 5, 2026 19:40
@pelikhan pelikhan marked this pull request as ready for review January 5, 2026 19:48
@pelikhan pelikhan merged commit 3af9ae6 into main Jan 5, 2026
4 checks passed
@pelikhan pelikhan deleted the copilot/update-safe-output-type-plan branch January 5, 2026 19:48
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