-
Notifications
You must be signed in to change notification settings - Fork 3
refactor(agents): improve writeAgents with file-level tracking #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.31-pr.228.043cc19Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.31-pr.228.043cc19"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.31-pr.228.043cc19"
}
}
Preview published to npm registry — try new features instantly! |
…ip-unchanged Refactor writeAgents to track files by content name rather than filename, enabling correct updates when filenames don't match agent names. Skip writing unchanged data to preserve comments and formatting. Add duplicate name validation in write path for consistency with readAllAgents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
423bc4e to
57ac95b
Compare
|
@claude run lint fix and typecheck fix |
|
Claude finished @Paveltarno's task in 32s —— View job Unable to run lint fix and typecheckI attempted to run the requested commands but I don't have permission to execute Bash commands in this repository. The following commands require approval:
What you can doTo allow me to run these commands, you'll need to update my permissions by adding bun install
bun run lint:fix
bun run typecheckAlternatively, you can approve the commands when I request them, or configure the repository to allow me to run Bash commands without approval. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
1 similar comment
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
The early return skipped writeAgents() when remote had 0 agents, preventing deletion of stale local files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@claude lint fix |
|
Claude finished @Paveltarno's task in 54s —— View job Lint fix completed
SummarySuccessfully ran Changes made:
The changes have been committed and pushed to the --- | View commit |
Co-authored-by: paveltarno <Paveltarno@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Note
Description
Refactors the
writeAgentsfunction to track files individually instead of just agent names. This enables smarter file handling: it now preserves custom filenames (e.g.,my-support-agent.jsoncinstead ofsupport.jsonc), skips writing when content is unchanged (preserving user comments and formatting), and only reports actual changes to the user. The pull command also now shows a clearer message when all agents are already up to date.Related Issue
None
Type of Change
Changes Made
writeAgentsto use file-level tracking withAgentFileEntryinterface containingdata,raw, andfilePathisDeepStrictEqualto skip writing unchanged files (preserves comments/formatting)agents pullcommand messaging to show "Syncing" instead of "Writing" and display "All agents are already up to date" when no changestests/core/agents_write.spec.ts) with 206 new lines covering file tracking, deletion, custom filenames, and unchanged file preservationTesting
npm test)Checklist
Additional Notes
This refactoring improves the user experience by being less intrusive with file modifications. Users can now rename agent files to their preference (e.g.,
my-support-agent.jsonc) and the CLI will respect that naming. Additionally, if the remote agent data hasn't changed, the local file won't be touched, preserving any comments or formatting users may have added.🤖 Generated by Claude | 2026-02-11 21:15 UTC