feat(workflow-copilot): add copilot sdk task#2402
Open
DLehenbauer wants to merge 10 commits into
Open
Conversation
…low engine Introduces a new `copilot.invoke` builtin task that drives schema-guided Copilot agent turns via a new `CopilotClientHost` abstraction backed by `@github/copilot-sdk` 0.3.0. TaskContext is extended with an `outputSchema` field so tasks can use structured output contracts to shape their computation.
DLehenbauer
commented
May 27, 2026
DLehenbauer
commented
May 27, 2026
DLehenbauer
commented
May 27, 2026
DLehenbauer
commented
May 27, 2026
curtisman
reviewed
May 27, 2026
| * Authoritative for this call: equal to or a narrowing of the | ||
| * registered task's inputSchema (decision 0003 Option 1'). | ||
| */ | ||
| inputSchema: JSONSchema; |
Member
There was a problem hiding this comment.
I don't see that being added in the code. Also, you already got the input, do you actually need the inputSchema?
Author
There was a problem hiding this comment.
You're right -- I added it, didn't use it, and the removal was incomplete. Should be fixed now.
Update decision 0011 to reflect that only outputSchema was added to TaskContext; inputSchema was removed because no consumer needed it. Addresses PR microsoft#2402 review feedback.
# Conflicts: # ts/pnpm-lock.yaml
Declare concrete builtin tasks with ConcreteTaskDefinition<...> and generic builtin tasks with GenericTaskDefinition<...> instead of the looser TaskDefinition<...> union. Annotations now match what each task actually is (concrete or generic), per the schemas in builtinTaskSchemas.ts. Removes the need for downstream consumers (e.g. tests) to type-assert when reading .inputSchema/.outputSchema.
…concrete Add per-task one-line comments in builtinTasks.ts and builtinTaskSchemas.ts explaining why these are NOT generic over N like their arithmetic siblings (divide: int/int can yield non-int; floor/round/ceil: output is always integer regardless of input).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Revert 88e231e. The TaskDefinition<...> union (concrete | generic) is sufficient for builtin task declarations. Only one downstream consumer (copilotInvoke.spec.ts) needed to read .inputSchema directly, so add a narrow ConcreteTaskDefinition cast there instead of widening the public declaration types of every builtin. Keeps the explanatory comments added in cacd4bc about which builtins are intentionally concrete despite their arithmetic siblings being generic (math.divide, math.floor/round/ceil). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the pre-existing 3-line explanation above math.divide in builtinTaskSchemas.ts that was inadvertently truncated in cacd4bc. The newly added per-task comments on math.floor/round/ceil and on mathDivide in builtinTasks.ts are kept as-is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
copilot.invoke(..)as a new workflow engine task that invokes the Copilot agent via the Copilot SDK.