Skip to content

fix(core): invoke afs methods with aigne context#930

Merged
li-yechao merged 1 commit into
mainfrom
feat-afs-call-context
Jan 20, 2026
Merged

fix(core): invoke afs methods with aigne context#930
li-yechao merged 1 commit into
mainfrom
feat-afs-call-context

Conversation

@wangshijun

@wangshijun wangshijun commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pass AIGNEContext to AFS skill operations (read, write, edit, list, delete, rename, search, exec) so that userId, sessionId, and other context identifiers flow through to AFS methods
  • Fix test import paths to use explicit .js extension for ESM compatibility
  • Replace unstable inline snapshots containing dynamic UUIDs with stable assertions that verify context structure without checking exact ID values

Test plan

  • Run bun test test/prompt/skills/afs/ - all 56 tests pass
  • Run bun test test/prompt/prompts/afs-builtin-prompt.test.ts - passes

Summary by AIGNE

Release Notes

Refactor:

  • Enhanced AFS (Agent File System) operations to properly utilize AIGNE context, enabling better session and user tracking across file system interactions

Test:

  • Improved test suite ESM compatibility with explicit .js extensions
  • Updated AFS skill tests to verify proper context propagation instead of relying on unstable snapshots

Note: This change improves internal context handling for file operations, ensuring proper user session management and traceability within the AIGNE system.

@github-actions

github-actions Bot commented Jan 20, 2026

Copy link
Copy Markdown

Image description AIGNE CodeSmith

Walkthrough

This PR enables AIGNE context propagation through AFS (Agent File System) operations by updating skill method signatures to accept and utilize the options parameter, passing options.context to underlying AFS calls. The changes ensure proper context flow containing userId, sessionId, and other identifiers throughout file system operations. Test files are updated for ESM compatibility with explicit .js extensions and replace unstable UUID snapshots with stable context structure assertions.

Changes

Files Summary
packages/core/src/prompt/skills/afs/*.ts (8 files: delete, edit, exec, list, read, rename, search, write) Updated process method signatures to accept and utilize the options parameter (removing underscore prefix) and pass options.context to underlying AFS method calls, enabling AIGNEContext propagation through all AFS operations.
packages/core/test/prompt/skills/afs/*.test.ts and related test files (11 files) Added explicit .js extensions to import statements for ESM compatibility and replaced unstable inline snapshots containing dynamic UUIDs with stable assertions that verify AFS operations receive proper AIGNEContext objects with expected structure.

@wangshijun wangshijun requested a review from li-yechao January 20, 2026 11:51
@codecov

codecov Bot commented Jan 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@li-yechao li-yechao merged commit 9cd7107 into main Jan 20, 2026
8 checks passed
@li-yechao li-yechao deleted the feat-afs-call-context branch January 20, 2026 12:38
@li-yechao li-yechao mentioned this pull request Jan 20, 2026
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