Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: github/copilot-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 82b96a1
Choose a base ref
...
head repository: github/copilot-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 209d9ae
Choose a head ref
  • 6 commits
  • 8 files changed
  • 1 contributor

Commits on Jul 15, 2026

  1. Phase 1: Contract skeleton and feature flag

    Regenerate SDK wire types (nodejs/src/generated/rpc.ts) from the updated runtime schema for the new workflow.* methods and DTOs, and mirror WorkflowMeta/WorkflowLimits in the SDK public types (nodejs/src/types.ts) with exports via index.ts/extension.ts. No behavior wired (contract skeleton only).
    
    Verification: cd nodejs && npm run build (Node 22) exit 0. Deviations: none.
    MRayermannMSFT committed Jul 15, 2026
    Configuration menu
    Copy the full SHA
    c4cc322 View commit details
    Browse the repository at this point in the history
  2. Phase 2: SDK authoring surface (defineWorkflow + registration)

    Add the SDK-side Dynamic Workflows authoring surface: defineWorkflow (opaque frozen WorkflowHandle, module-local name->{meta,run} map, optional limits that reject non-positive values), workflows?: WorkflowHandle[] on the extension JoinSessionConfig only (serializing just WorkflowMeta on the wire, never the run closure), the workflow.execute reverse handler (dispatch-by-name with a stub ctx of args+log-noop+return, structured error on unknown name) and workflow.abort handler (per-run AbortController keyed by runId), both registered before session.resume, and the session.workflow.run friendly wrapper (name/handle overloads; foreground unwraps completed result and throws exported WorkflowRunError on non-completed; background returns the envelope). Exports from index.ts and extension.ts.
    
    SDK-only; runtime untouched; no generated files edited.
    
    Verification (Node 22, exit 0): npm run build; npm test -- test/workflow.test.ts (12 passed); typecheck; targeted ESLint. Deviations: none.
    MRayermannMSFT committed Jul 15, 2026
    Configuration menu
    Copy the full SHA
    594c688 View commit details
    Browse the repository at this point in the history
  3. Phase 4: Host API context, part 1 (args, log, phase, return)

    Build the real run() WorkflowContext in the SDK workflow.execute handler (replacing the Phase 2 stub): populate args; set ctx.session to the identical CopilotSession instance joinSession returned (strict === identity, no wrapper); expose ctx.signal as the per-run AbortController's AbortSignal; and implement log()/phase() as synchronous calls that buffer each line with a monotonic seq and flush incrementally over workflow.log (at await boundaries, a short unref'd timer, and a guaranteed finally-flush so no buffered narration is lost on a throwing/aborted body).
    
    SDK side of Phase 4; runtime workflow.log handler is the companion commit.
    
    Verification (Node 22, exit 0): npm run build; npm test -- test/workflow.test.ts (16 passed); typecheck; lint. Deviations: none.
    MRayermannMSFT committed Jul 15, 2026
    Configuration menu
    Copy the full SHA
    f29ad57 View commit details
    Browse the repository at this point in the history
  4. Phase 5: The one-agent executor (agent() via in-session subagents)

    Implement ctx.agent in the SDK run() context: it calls workflow.agent carrying the closed-over workflowRunId and the model, returns the subagent result text, and trims opts to label/schema/model only (effort/isolation/agentType/tool-narrowing are not v1). Schema handling arrives in Phase 6.
    
    Verification (Node 22, exit 0): npm run build; npm test -- test/workflow.test.ts (17 passed, asserts effort is dropped). Deviations: none.
    MRayermannMSFT committed Jul 15, 2026
    Configuration menu
    Copy the full SHA
    4ab5967 View commit details
    Browse the repository at this point in the history
  5. Phase 6: Structured output (agent({ schema })) and retry

    Document the supported schema subset on the WorkflowContext agent() schema option (examon validator subset, not arbitrary JSON Schema) so authors do not expect unsupported keywords. Companion to the runtime Rust parse/validate.
    
    Verification (Node 22, exit 0): npm run build; npm run typecheck; npm test -- test/workflow.test.ts. Deviations: none.
    MRayermannMSFT committed Jul 15, 2026
    Configuration menu
    Copy the full SHA
    cc6e45b View commit details
    Browse the repository at this point in the history

Commits on Jul 16, 2026

  1. Phase 7: Combinators (parallel, pipeline) and the per-run limiter

    Implement ctx.parallel(thunks) as a barrier fan-out (awaits all; throwing thunk -> null) and ctx.pipeline(items, ...stages) as per-item staged flow with no barrier (throwing stage nulls that item and skips its remaining stages). Both are pure SDK control flow holding no slot; concurrency is enforced by the runtime per-run limiter (each leaf ctx.agent is a workflow.agent RPC that queues until admitted). Enforce the non-configurable 4096 per-fan-out item cap, and validate element types up front so passing already-invoked promises surfaces a clear pass-functions-not-promises diagnostic instead of silently resolving to all-nulls.
    
    Verification (Node 22, exit 0): npm run build; npm test -- test/workflow.test.ts (22 passed); typecheck. Deviations: none.
    MRayermannMSFT committed Jul 16, 2026
    Configuration menu
    Copy the full SHA
    209d9ae View commit details
    Browse the repository at this point in the history
Loading