Skip to content

Add an SDK-neutral agent runtime interface - #6

Merged
pelikhan merged 4 commits into
mainfrom
copilot/refactor-agent-interface
Jul 22, 2026
Merged

Add an SDK-neutral agent runtime interface#6
pelikhan merged 4 commits into
mainfrom
copilot/refactor-agent-interface

Conversation

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Rig needs to run against Copilot, Pi, Anthropic, Codex, or other SDKs without provider-specific execution paths.

Changes

  • Runtime abstraction

    • Added a minimal Agent interface with ask() and close().
    • Added AgentFactory and configureAgent() for SDK adapter registration.
    • Rig creates one configured implementation per invocation.
  • Copilot adapter

    • Refactored copilotEngine() into an AgentFactory.
    • Encapsulated Copilot session creation, messaging, events, and cleanup.
  • SDK-neutral APIs

    • Replaced addon session access with context.agent.
    • Renamed oncePerSession() to oncePerAgent().
    • Decoupled tool definitions from Copilot SDK types.
configureAgent(async ({ model, systemMessage, tools }) =>
  new MySdkAgent({ model, systemMessage, tools })
);

Copilot AI and others added 2 commits July 22, 2026 18:51
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add SDK-neutral agent runtime interface Add an SDK-neutral agent runtime interface Jul 22, 2026
Copilot AI requested a review from pelikhan July 22, 2026 18:54
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot import agent sdk for

  • pi-agent
  • Anthropic sdk

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

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot import agent sdk for

  • pi-agent...

Added pi-agent and Anthropic SDK adapters with tool mapping, stateful turns, cancellation/error handling, tests, and usage docs in 6290080.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot Add tests

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

Copilot AI commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Add tests

Added focused pi-agent and Anthropic adapter tests in 45961a0, covering cancellation, validation, defaults, and mixed response content.

@pelikhan
pelikhan marked this pull request as ready for review July 22, 2026 22:46
@pelikhan
pelikhan merged commit 14778e9 into main Jul 22, 2026
4 checks passed
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