Skip to content

feat: smart sessions core revamp#181

Merged
vr16x merged 5 commits intodevelopfrom
feat/smart-sessions-revamp-core
Mar 3, 2026
Merged

feat: smart sessions core revamp#181
vr16x merged 5 commits intodevelopfrom
feat/smart-sessions-revamp-core

Conversation

@vr16x
Copy link
Collaborator

@vr16x vr16x commented Feb 3, 2026

PR-Codex overview

This PR introduces a debug mode for the SDK, enhancing error logging and adding new functionalities for session management and action policies. It also refines existing methods and types to support these features, improving overall usability and clarity.

Detailed summary

  • Added isDebugMode property in several interfaces.
  • Introduced signSessionQuote and executeSessionQuote functions for session management.
  • Enhanced error logging to utilize console.error when isDebugMode is true.
  • Updated various functions to support simulationOverrides.
  • Improved action policy building with new methods for session actions.
  • Refined types and parameters in multiple files for better clarity and usability.

The following files were skipped due to too many changes: src/sdk/account/decorators/buildActionPolicy.ts, src/sdk/modules/validators/smartSessions/decorators/mee/prepareForPermissions.ts, src/sdk/account/decorators/buildSessionAction.ts, src/sdk/account/decorators/buildSessionAction.test.ts, src/sdk/clients/decorators/mee/getQuoteSimulations.test.ts, src/sdk/clients/decorators/mee/getSessionQuote.test.ts, src/sdk/clients/decorators/mee/getSessionQuote.ts, src/sdk/modules/validators/smartSessions/toMultichainSmartSessions.test.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

size-limit report 📦

Path Size
core (esm) 81.27 KB (+3.49% 🔺)
core (cjs) 102.31 KB (+3.38% 🔺)
bundler (tree-shaking) 7 KB (+0.05% 🔺)
paymaster (tree-shaking) 543 B (0%)

@vr16x
Copy link
Collaborator Author

vr16x commented Feb 3, 2026

1 test case failed because of the hook timeout glitch. So all good

@fichiokaku
Copy link
Contributor

just one thing I've noticed:

If the user already has an action for the fee token (same selector + address) but with a policy that is not SPENDING_LIMITS_POLICY_ADDRESS (e.g. only usage or time-frame), the code leaves that action unchanged and does not add a separate payment action (isPolicyForPaymentTokenExists is true). So the session might not have a spending limit for fees

So could we:

  • add a spending-limit policy to that existing action when the target is the fee token , or
  • add a separate payment action when no spending limit exists for the fee token,
    so that “same as feeToken” always gets a payment policy merged in, not only when there’s already a spending-limit policy?

@fichiokaku
Copy link
Contributor

calldataArgument is exported from buildActionPolicy and used in tests and in prepare-for-smart-session. Should we in general export this to our sdk users?

@vr16x
Copy link
Collaborator Author

vr16x commented Feb 20, 2026

@fichiokaku The payment policy checks happens and if its missing its being added here. So we're good here

https://github.com/bcnmy/abstractjs/pull/181/changes#diff-a9eb77c527ef34aef0b19399fe428629e86a8ef4e55f2aa3fe902dfa20194209R455

@vr16x
Copy link
Collaborator Author

vr16x commented Feb 20, 2026

calldataArgument is exported from buildActionPolicy and used in tests and in prepare-for-smart-session. Should we in general export this to our sdk users?

This is a good catch, I wanted this to be exported for developers as well. Will fix this

UPDATED: Its fixed

* feat: build action and action policy abstrations

* chore: code formats

* feat: added some improvements and test coverage

* chore: code formats

* test: added test coverage

* chore: code formats

* feat: fixed some test issues

* feat: smart sessions enable permission action split (#183)

* feat: smart sessions permission action split

* feat: added module install dependencies via conditions

* chore: code formats

* feat: added conditional dependency for enable permissions

* feat: build batch actions implemented

* feat: code formatting

* feat: refactored the legacy payment policy logics

* chore: code formats

* feat: smart session abstraction 2 (#185)

* feat: smart session abstraction 2

* feat: refactored the prepareForPermission code flow

* feat: added test coverage for broad cases

* chore: code formats

* feat: added more test coverage

* chore: code formats

* feat: added debug mode for consoles

* feat: minor improvements and test coverage

* chore: code formats

* feat: smart sessions revamp pr fixes (#186)

* feat: fixed all the pr suggestions

* chore: code formats

* feat: payment policy logic is refactored

* feat: increased the build size

* fix: build issue fixed

* feat: fixed the time units

* feat: modified the tests

* feat: addressed pr comments
@vr16x vr16x changed the title feat: added 7702, enablePermissions and re-exported policies feat: smart sessions core revamp Feb 24, 2026
@vr16x vr16x requested a review from filmakarov February 24, 2026 14:46
Filipp Makarov and others added 2 commits February 26, 2026 12:55
* chore: merge mee3 support

* chore: add support for stx validator initdata

* chore: lint

* chore: add unit tests for session validator initdata generation

* chore: lint

---------

Co-authored-by: Filipp Makarov <fmc@Filipps-MacBook-Pro.local>
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 93.90582% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.73%. Comparing base (44b050f) to head (3cb6e02).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
src/sdk/clients/decorators/mee/getSessionQuote.ts 94.47% 12 Missing ⚠️
src/sdk/account/decorators/buildActionPolicy.ts 82.53% 11 Missing ⚠️
...ients/decorators/mee/getSupertransactionReceipt.ts 0.00% 8 Missing ⚠️
...clients/decorators/mee/getQuoteSimulations.test.ts 50.00% 7 Missing ⚠️
...sdk/clients/decorators/mee/getSessionQuote.test.ts 97.10% 6 Missing ⚠️
...rtSessions/decorators/mee/prepareForPermissions.ts 83.78% 6 Missing ⚠️
src/sdk/account/decorators/buildSessionAction.ts 93.75% 5 Missing ⚠️
src/sdk/clients/decorators/mee/getFusionQuote.ts 71.42% 2 Missing ⚠️
src/sdk/clients/decorators/mee/getQuote.ts 0.00% 2 Missing ⚠️
src/sdk/modules/utils/Helpers.ts 0.00% 2 Missing ⚠️
... and 5 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #181      +/-   ##
===========================================
+ Coverage    73.28%   77.73%   +4.45%     
===========================================
  Files          265      284      +19     
  Lines         9404    11450    +2046     
  Branches      1325     1597     +272     
===========================================
+ Hits          6892     8901    +2009     
- Misses        2512     2549      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vr16x
Copy link
Collaborator Author

vr16x commented Mar 3, 2026

@vr16x vr16x merged commit 988e508 into develop Mar 3, 2026
9 of 12 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.

3 participants