fix(kernel): sync all agent.toml fields to DB on restart#1118
Open
octo-patch wants to merge 1 commit intoRightNow-AI:mainfrom
Open
fix(kernel): sync all agent.toml fields to DB on restart#1118octo-patch wants to merge 1 commit intoRightNow-AI:mainfrom
octo-patch wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
…Now-AI#1087) The TOML-vs-DB change detection at boot only checked a subset of fields, causing edits to workspace, schedule, resources, autonomous, and exec_policy to be silently ignored after a restart. Add the missing fields to the changed-detection predicate so the kernel properly reflects all agent.toml edits in the SQL database. The workspace comparison is intentionally guarded — if the TOML omits workspace (None), the kernel-assigned default path already stored in the DB is kept rather than being overwritten with None. Derive PartialEq on ScheduleMode, AutonomousConfig, ResourceQuota, and ExecPolicy to enable the comparisons without manual field-by-field expansion. Co-Authored-By: Octopus <liyuan851277048@icloud.com>
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 #1087
Problem
The TOML-vs-DB change detection at boot time only compared a subset of
AgentManifestfields (name,description,model.*,capabilities.tools,tool_allowlist,tool_blocklist,skills,mcp_servers). Key fields likeworkspace,schedule,resources,autonomous, andexec_policyweresilently skipped, so editing them in
agent.tomland restarting OpenFang hadno effect — the old values from the SQL database were used instead.
Solution
PartialEqonScheduleMode,AutonomousConfig,ResourceQuota,and
ExecPolicyso they can be compared directly.changedpredicate in the boot-time TOML sync loop to cover allthe previously missing fields.
workspacecomparison is guarded: if the TOML omits the field (None),the kernel-assigned default path already in the DB is preserved rather than
being overwritten. If the TOML explicitly sets a path, that path is compared
against the DB and an update is triggered when they differ.
Testing
Manually verified the fix by:
workspacein itsagent.toml.workspace = "/tmp/custom-workspace"toagent.toml.used by the agent.
workspaceline — confirmed restart preserves the previouslyset path rather than reverting to the auto-generated default.