Repository navigation
fix: restore saved agent state across restarts, and release 0.8.3 - #80
Merged
Merged
Conversation
An agent starts with an empty local copy of its own state and of the guild state, and only fills it from state responses. After a relaunch nothing sent it what the state manager had kept, so a guild with a persistent state store behaved as if its state were gone. When an agent first reports running, the guild manager now sends it its saved state and the guild state on the state topic. State that was never saved is not sent.
A guild gets its default state manager, and the configuration DiskCache needs, only when it is created. A guild stored before a default was configured was relaunched without either, so its manager read DiskCache from the environment with no cache_dir and stopped. Every Guild Manager spawn is rebuilt from the stored guild. That rebuild now applies the same state manager defaults as bootstrap, through a shared ApplyStateManagerDefaults. A guild that names its own state manager keeps it.
The embedded NATS keeps its data across restarts, agent statuses included. After an abrupt exit, a guild manager's status still read as running for up to its 30-second lease. A relaunch in that window was skipped, so the guild never started and its chat stayed on the launching screen. When the server boots its own embedded NATS, which no other node shares, it now clears the statuses the previous run left. External NATS and Redis keep relying on the lease.
A blueprint template that lists the models picked for a multiple profile
selection only ever got their keys, because templates are rendered from the
raw configuration before the selections are resolved. The Multi-LLM Guild's
/add-agent form therefore offered llm_local_qwen3_5_2b instead of Qwen 3.5 2B
Balanced.
Templates now see each selected profile as {key, display_name}, which the
blueprint schemas already allow. The guild keeps the keys.
Forge 0.8.3 runs the Todo agent fixes and the refresh flag that rusticai-core 1.5.2 adds.
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.
Fixes found while testing Rustic Studio with guild state kept on disk, plus Forge 0.8.3. Studio's DiskCache default depends on these.
Changes
Restore saved state when an agent starts (
790140b, forge-python)State manager defaults for relaunched guilds (
0c79f82)cache_dirDiskCache needs, only when it was created. A guild stored before a default was configured was relaunched without either, so its manager read DiskCache from the environment with nocache_dirand stopped.ApplyStateManagerDefaults. A guild that names its own state manager keeps it.Clear agent statuses left by the previous run (
8af1c14)Model names for blueprint templates (
deaed10){key, display_name}, which the schemas already allow; the guild keeps the keys.Versions
ad4e363).rusticai-core>=1.5.2(13c756d), for the Todo agent fixes released in 1.5.2.Validation
go test ./...passes, andgolangci-lintv2.15.0 reports 0 issues.ApplyStateManagerDefaults;NATSAgentStatusStore.Clear;/add-agentform listed model names.tests/test_forge_integration.pyandtests/test_forge_api_contract.py. Their harness needsFORGE_LOCAL_USER_ID,FORGE_LOCAL_ORGANIZATION_IDand a registry path that isn't set up on this machine.