Skip to content

fix(https-outcalls): Motoko reaches version 2 and flexible outcalls - #452

Open
eichhorl wants to merge 3 commits into
mainfrom
eichhorl/motoko-outcalls-parity
Open

eichhorl wants to merge 3 commits into
mainfrom
eichhorl/motoko-outcalls-parity

Conversation

@eichhorl

@eichhorl eichhorl commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What changed upstream

The ic mops package gained a builder for http_request in 6.0.0 (2026-11-02). It selects pricing version 2 on every call, takes the four expectations that narrow the cycles it reserves, and ships a counterpart for flexible_http_request. It needs moc 2.1.0 for the costHttpRequestV2 primitive it calls. It deliberately does not call subnetSelfNodeCount, which moc 2.1.0 also added: that would make every canister importing Call require a replica with ic0.subnet_self_node_count.

Motoko now reaches the same outcall surface as Rust. The skill said the opposite in eight places.

What this fixes

The support matrix listed version 2, flexible_http_request and subnet_self_node_count as not available in Motoko. Seven further passages repeated it: the version-1-only paragraph, pitfalls 2 and 14, the Motoko implementation section, the cycle cost section, the frontmatter compatibility field, and both reference files (pricing-version-2.md, flexible-outcalls.md).

They now describe one surface for both languages, and name the dependency versions that reach it. That part matters: ic 4.x and 5.x are still version 1, so the skill distinguishes them rather than saying "Motoko does version 2" flatly. On 4.x there is no pricing_version field at all, which is why that code is consistently version 1 rather than mismatched.

The Motoko example moves from the args-record call to the builder. The flexible reference also tells Motoko callers to set replication: because ic 6.0.0 does not read the subnet size, a call with replication unset reserves for full-size responses.

Evaluation

output_evals[9] was adversarial: "Adversarial: Motoko has no pay-as-you-go pricing yet", asserting the model should say there is no version 2 path and should not fabricate a builder. That assertion is now false, and the eval would fail a correct answer.

It is inverted into a positive capability test under the same prompt: use the builder, state the version requirement, leave pricing_version and the cycles to it, and do not present the 4.x/5.x Call.httpRequest(args) form as the version 2 entry point.

Verification

The Motoko example in the skill was extracted and compiled against ic 6.0.0 with moc 2.1.0: builds clean. node scripts/check-project.js passes for all 35 skills (the two warnings are unrelated skills missing evaluation files). skill-validator 1.5.1, the version CI installs, reports one warning on this skill, a code-language mix that predates this PR.

Related

The matching examples landed in dfinity/examples#1490, and the docs follow in dfinity/developer-docs#448.

One finding worth passing to the migrating-to-moc-2 skill when it syncs in: a project on moc 2.x cannot depend on base, directly or transitively. base still ships ExperimentalStableMemory, whose primitives moc 2.0 removed, so mops check fails on it even when nothing imports it and mops build succeeds. That holds up to and including the latest base 0.16.0; core is unaffected. It is why daily_planner could not be migrated in the examples PR.

🤖 Generated with Claude Code

The `ic` mops package gained a builder in 6.0.0 that selects pricing
version 2, takes the expectations narrowing its reservation, and has a
counterpart for `flexible_http_request`. It needs `moc` 2.1.0 for the
`costHttpRequestV2` and `subnetSelfNodeCount` primitives it calls.

The support matrix said none of that was available, and six further
passages repeated it: the version-1-only paragraph, two pitfalls, the
Motoko example, the cycle cost section, and the frontmatter. The two
references carried the same claim. All of them now describe one surface
for both languages, and name the dependency versions that reach it, since
`ic` 4.x and 5.x are still version 1.

The Motoko example moves to the builder and compiles against `ic` 6.0.0
with `moc` 2.1.0.

The adversarial evaluation asserting Motoko has no version 2 path is
inverted: it now checks that the builder is used, that the version
requirement is stated, and that `pricing_version` and the cycles are left
to it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@eichhorl
eichhorl requested review from a team and JoshDFN as code owners November 5, 2026 14:16
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Skill Validation Report

Validating skill: /home/runner/work/icskills/icskills/skills/https-outcalls

Structure

  • Pass: SKILL.md found
  • Pass: all files in references/ are referenced

Frontmatter

  • Pass: name: "https-outcalls" (valid)
  • Pass: description: (492 chars)
  • Pass: license: "Apache-2.0"
  • Pass: compatibility: (187 chars)
  • Pass: metadata: (2 entries)

Tokens

  • Warning: SKILL.md body is 8013 tokens (spec recommends < 5000)

Markdown

  • Pass: no unclosed code fences found

Tokens

File Tokens
SKILL.md body 8,013
references/flexible-outcalls.md 3,024
references/json-responses.md 491
references/pricing-version-2.md 4,192
Total 15,720

Content Analysis

Metric Value
Word count 4,802
Code block ratio 0.32
Imperative ratio 0.08
Information density 0.20
Instruction specificity 0.78
Sections 16
List items 26
Code blocks 9

References Content Analysis

Metric Value
Word count 4,922
Code block ratio 0.15
Imperative ratio 0.04
Information density 0.09
Instruction specificity 0.63
Sections 16
List items 26
Code blocks 9

Contamination Analysis

Metric Value
Contamination level low
Contamination score 0.12
Primary language category shell
Scope breadth 3
  • Warning: Language mismatch: config, systems (2 categories differ from primary)

References Contamination Analysis

Metric Value
Contamination level low
Contamination score 0.00
Primary language category systems
Scope breadth 1

Result: 1 warning

Project Checks


✓ Project checks passed for 1 skills (0 warnings)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation omits ic 5.x from the legacy-pricing row and retains unqualified version-1 funding guidance that conflicts with the 6.x builder’s version-2 behavior.

2 open issues
What changed in this PR

Updates the HTTPS outcalls skill to document Motoko support for pricing version 2 and flexible outcalls through ic 6.0.0+ with moc 2.1.0+.

Changes:

  • Revises the support matrix and pricing guidance while distinguishing legacy ic 4.x/5.x behavior.
  • Converts Motoko examples to the builder API with automatic cycle attachment.
  • Replaces the obsolete capability-denial evaluation with a version-2 builder test.
File Description
skills/​https-outcalls/​SKILL.md Updates compatibility, pricing guidance, and Motoko examples.
skills/​https-outcalls/​references/​pricing-version-2.md Documents Motoko’s version-2 dependency requirements.
skills/​https-outcalls/​references/​flexible-outcalls.md Adds Motoko flexible-outcall and subnet-size APIs.
evaluations/​https-outcalls.json Tests the supported Motoko version-2 builder workflow.

Review effort: Balanced

Comment thread skills/https-outcalls/SKILL.md Resolved
The support matrix listed only `ic` 4.x as the way to keep legacy pricing,
while the paragraph below it and the implementation section both say 4.x
and 5.x are version 1. Read alone, the row sends a project already on 5.x
to downgrade for no reason.

`pricing-version-2.md` kept an unqualified "Motoko's `Call.httpRequest`
pairs version 1 with `cost_http_request`" in "Version and funding must
agree", which is the section an agent reads to decide what to attach. It
now names the version that behaviour belongs to, and says the pairing is
the builder's either way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@eichhorl

eichhorl commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Both Copilot comments were right; both were inconsistencies this PR introduced.

Support matrix (SKILL.md:25) — the legacy-pricing row named only ic 4.x, while the paragraph two lines below and the implementation section both say 4.x and 5.x are version 1. Read on its own, the row tells a project already on 5.x to downgrade for nothing. It now names both.

pricing-version-2.md — "Version and funding must agree" still carried an unqualified "Motoko's Call.httpRequest pairs version 1 with cost_http_request". That is the section an agent consults to decide what to attach, so leaving it unqualified would have kept producing the legacy answer this PR exists to correct. It now names the version each behaviour belongs to, and adds that the pairing is the builder's either way, since both overwrite pricing_version even when started from arguments you assembled yourself.

check-project.js passes (the two warnings are unrelated skills), and checks / validate is green.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the Motoko HTTPS outcall documentation and example updates.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

The released ic 6.0.0 calls only Prim.costHttpRequestV2. It dropped
Prim.subnetSelfNodeCount so that canisters importing Call still install
on replicas without ic0.subnet_self_node_count. The support note said it
calls both.

That also means a Motoko flexible outcall with replication unset reserves
for full-size responses, so the flexible reference now says to set it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the Motoko HTTPS outcall documentation and evaluation updates.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
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