Skip to content

fix(agent): avoid concurent restart lead to an empty schema sending#1577

Merged
arnaud-moncel merged 3 commits intomainfrom
fix/agent-restart
May 5, 2026
Merged

fix(agent): avoid concurent restart lead to an empty schema sending#1577
arnaud-moncel merged 3 commits intomainfrom
fix/agent-restart

Conversation

@arnaud-moncel
Copy link
Copy Markdown
Member

@arnaud-moncel arnaud-moncel commented May 5, 2026

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

Note

Fix concurrent Agent.restart calls sending an empty schema

  • Adds an isRestarting boolean guard to Agent that prevents overlapping restart calls, logging a debug message and returning early when a restart is already in progress.
  • The guard is reset in a try/finally block so it clears correctly even if the rebuild throws.
  • New tests in agent.test.ts cover single rebuild on concurrent calls, recovery after completion, and info logging on accepted restarts.

Macroscope summarized d858470.

Comment thread packages/agent/src/agent.ts
@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 5, 2026

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
packages/agent/src/agent.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@arnaud-moncel arnaud-moncel merged commit 8a74465 into main May 5, 2026
29 checks passed
@arnaud-moncel arnaud-moncel deleted the fix/agent-restart branch May 5, 2026 15:29
forest-bot added a commit that referenced this pull request May 5, 2026
## @forestadmin/agent [1.78.10](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.78.9...@forestadmin/agent@1.78.10) (2026-05-05)

### Bug Fixes

* **agent:** avoid concurent restart lead to an empty schema sending ([#1577](#1577)) ([8a74465](8a74465))
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