Conversation
- Local II needs agentOptions (host + root key): the client mints delegations via the II canister and its agent defaults to mainnet - Local II must come from a recent network launcher (`icp network update`) - Pitfalls: getIdentity() inside a subscribe() listener, and logout timers set from the short-lived delegation's expiration - Evals 27-29 for the new pitfalls
Skill Validation ReportValidating skill: /home/runner/work/icskills/icskills/skills/internet-identityStructure
Frontmatter
Tokens
Markdown
Tokens
Content Analysis
Contamination Analysis
Result: 2 warnings Project Checks |
sea-snake
reviewed
Sep 23, 2026
sea-snake
reviewed
Sep 23, 2026
The auth client's agent already resolves to the page origin on localhost; without the local root key the mint fails certificate verification. Eval 27 updated accordingly, and its mainnet-II check scoped to the fix.
sea-snake
added a commit
to dfinity/icp-js-auth
that referenced
this pull request
Sep 23, 2026
…gn-in it was told about (#198) A `subscribe()` listener that calls `getIdentity()` on a `signed-in` status gets `SessionNotHeldError`. The listener runs when the record changes, and for a sign-in that happens before the client installs the identity: - **This tab's sign-in:** `signIn()` writes the record in `#persistSession`, and only installs the identity after promoting the app credential and opening the session. - **A peer's sign-in:** the subscription ran the listeners before `#restoreAgain()`, so the listener's `getIdentity()` awaited the previous, already settled restore. Changes: - `signIn()` wraps the write-and-install step in a `#committing` promise, and `getIdentity()` waits for it after `#init()`. Only that step counts, so a `getIdentity()` while the signer window is open does not wait on the user. A ceremony failing partway still ends in `SessionNotHeldError`. - The subscription reads the status, queues the restore (same guard), and then notifies. `getStatus()` still returns the new record inside a listener. Tests: two regression tests, one per case. Each fails with `SessionNotHeldError` without its half of the fix. Full suite, typecheck and biome pass. Reported in dfinity/icskills#404 (comment). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n icp-js-auth#198
marc0olo
enabled auto-merge (squash)
September 23, 2026 14:33
sea-snake
approved these changes
Sep 23, 2026
Member
Author
|
Pushed 2a001a1: the Eval case 4 ( Eval: case 4 (changed)WITH 4/5 | WITHOUT 3/5
Found while working on #405 ( |
This branch has not been deployed
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.
The skill's local-II fallback didn't work with
@icp-sdk/auth10: it set onlyidentityProvider, so sign-in against a local II (ii: true) failed after the ceremony. Found while migrating dfinity/examples to auth 10 (dfinity/examples#1487), where we keep local II.Verification
Checked against the
@icp-sdk/auth10.0.0 source and reproduced in a browser against a local network:app_prepare_delegation/app_get_delegationon the II canister (session-minter.ts), through anHttpAgentbuilt fromagentOptions. Its default host already resolves to the page origin onlocalhost, so the mint reaches the local replica, but without the local root key it fails withTrustError: Certificate verification error("Invalid signature"). Reproduced both: noagentOptions→ that error;agentOptions: { rootKey }only → sign-in, authenticated call, reload and logout work.hostis not needed.candid:service); the launcher shipping PocketIC 2026-09-18 has them.icp network updatefetches it.SessionIdentity, so a logout timer set from its expiration fires after minutes.The
subscribe()/getIdentity()pitfall from the first revision was dropped: the ordering it described is fixed in dfinity/icp-js-auth#198 (patch release pending), so the skill does not document it.Changes
skills/internet-identity/SKILL.md— local-II fallback:agentOptions+ snippet, and theicp network updaterequirement; pitfalls 18–19 (local II withoutagentOptions, delegation-expiry logout timers).skills/internet-identity/SKILL.md— thecreateAuthenticatedActorexample no longer setshost: window.location.origin(it breaks custom domains and contradicted the new guidance).evaluations/internet-identity.json— new adversarial cases 27–28, one per pitfall. Case 4 no longer acceptshost: window.location.origin(WITH 4/5 | WITHOUT 3/5; the remaining miss,getIdentity(), predates this change and contradicts the prompt).Evals
Cases 27–28 are new, so they are run with baseline. Cases 2 and 12 cover the local-II section and were re-run as a regression check (with skill only). The other cases were not re-run — none assert what changed. Re-checked on the final commit (70c4c61): cases 2, 12 and 28 still pass with the skill (4/4, 3/3, 4/4); case 27's content is unchanged since its run below.
Case 27 was updated after review (root key only, no
host), and its mainnet-II check was split out and scoped to the fix: the skill currently recommends mainnet II by default, so some with-skill runs add it as an aside, which the old wording counted as a failure. Before rescoping, 4 runs gave 2/4, 4/4, 4/4, 3/4, all misses from that aside or run variance. Two earlier baseline runs timed out; the result below is the first valid baseline.Eval 27 — Adversarial: local II sign-in without agentOptions — WITH 5/5 | WITHOUT 2/5
Eval 28 — Adversarial: logout timer from the delegation expiration — WITH 4/4 | WITHOUT 1/4
Eval 2 — Local II URL — WITH 4/4 | WITHOUT skipped
Eval 12 — local vs mainnet II usage — WITH 3/3 | WITHOUT skipped