Signum.Agent: AgentSkillEntity, runtime skill tree, headless loop#3
Open
olmobrutall wants to merge 24 commits intosync/signumsoftware-masterfrom
Open
Signum.Agent: AgentSkillEntity, runtime skill tree, headless loop#3olmobrutall wants to merge 24 commits intosync/signumsoftware-masterfrom
olmobrutall wants to merge 24 commits intosync/signumsoftware-masterfrom
Conversation
- Rename AgentSkill → AgentSkillCode (pure code-side definition, no tree) - Add AgentSkillEntity: DB-backed tree nodes with Name, SkillCode, Active, UseCase (AgentUseCaseSymbol), ShortDescription, Instructions overrides, PropertyOverrides (MList), and SubSkills (MList) defining the hierarchy - Add AgentUseCaseSymbol with DefaultChatbot and Summarizer built-in values - Add AgentSkillPropertyAttribute / AgentSkillProperty_QueryListAttribute for marking overridable skill properties with custom string converters - Add ResolvedSkillNode: runtime combination of entity + code + sub-tree, built from DB and cached via GlobalLazy (invalidated on entity changes) - Circular reference validation on save (DirectedGraph.FeedbackEdgeSet) - AgentSkillLogic.RegisterCode<T>() replaces hard-coded tree API - ChatbotController + ChatbotLogic updated to use ResolvedSkillNode via GetRootForUseCase(AgentUseCase.DefaultChatbot) - CurrentMcpRoot thread variable for IntroductionSkill.Describe/ListSkillNames - API endpoints: /api/agentSkill/registeredCodes, skillCodeDefaults, skillCodeProperties - AgentSkillClient.tsx registry: registerPropertyValueControl(attributeName, factory) - Templates/AgentSkill.tsx: MarkdownLine + LinkButton diff toggle vs code default, dynamic property value controls by attribute name, sub-skills table https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
…xecution - Add IAgentOutput interface with default no-op implementations for all events: OnSystemMessage, OnUserQuestion, OnSummarization, OnAssistantStarted, OnTextChunk, OnAssistantMessage, OnToolStart, OnToolFinished, OnTitleUpdated - Add NullAgentOutput singleton (no-op implementation) - Move agent loop (while-true LLM call + tool execution) from controller to ChatbotLogic.RunAgentLoopAsync(ConversationHistory, IAgentOutput, ct) - Move ExecuteToolAsync and FormatToolError to ChatbotLogic (static) - Add ChatbotLogic.RunHeadlessAsync(prompt, useCase, languageModel, output, ct) creates session, system msg, user msg and runs the loop without HTTP - Add HttpAgentOutput class in controller implementing IAgentOutput via UINotification streaming writes to HttpResponse - Simplify ChatbotController.AskQuestionAsync to HTTP setup + delegate to logic https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
- AgentSkillCodeEntity is now a SystemString entity auto-synced from code
via Schema_Generating/Schema_Synchronizing hooks (like EmailModelEntity)
- RegisterCode<T>() registers types only; instantiation via Activator.CreateInstance
- Merged SkillCodeDefaults+properties into single SkillCodeInfo response
- AgentSkillPropertyAttribute gains ValidateValue() called during entity save
- Removed ResolvedSkillNode: AgentSkillCode instances are built in-place at
resolve time with SubSkills wired from DB entity tree
- ConversationHistory.RootSkill: ResolvedSkillNode -> AgentSkillCode
- Controller: replaced 3 endpoints with single /api/agentSkill/skillCodeInfo/{code}
- Frontend: EntityCombo for skillCode field, single getSkillCodeInfo API call,
removed duplicate AgentSkillEntity settings registration from ChatbotClient
https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
IntroductionSkill is always the tree root, so Describe/ListSkillNames can use 'this' directly instead of a thread-local variable. https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
- LanguageModelLogic.cs: extracted from ChatbotLogic — entity setup for ChatbotLanguageModelEntity/EmbeddingsLanguageModelEntity, provider dictionaries, GetChatClient, ChatOptions, GetEmbeddingsAsync, lazy caches, IChatbotModelProvider/IEmbeddingsProvider interfaces - LanguageModelController.cs: extracted GET models/embeddingModels endpoints - All providers updated to call LanguageModelLogic.GetConfig() - ChatbotLogic.Start now delegates to LanguageModelLogic.Start - Removed all section-divider comments and XML doc blocks; kept only the UIToolAttribute summary and the SubSkills population hint https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
- LanguageModelClient: start() registers ChatbotLanguageModel/EmbeddingsLanguageModel entity settings; API.getModels/getEmbeddingModels methods - ChatbotClient: removed language model entity settings and model API methods; also removed the stale optiions typo and the UITool registry block comment - Templates updated to import from LanguageModelClient instead of ChatbotClient https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
…hST' into claude/check-repo-access-kohST # Conflicts: # Extensions/Signum.Agent/ChatbotLogic.cs
These plain DTO interfaces are not generated by the T4 template so they need to be declared manually in the .ts source file. https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
Signum.Agent.ts is auto-generated and would overwrite manual additions. Defining these plain DTO interfaces in AgentSkillClient.tsx instead; template updated to import SkillPropertyMeta from there. Also removed them from Signum.Agent.d.ts (derived file). https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
Framework is used as a submodule; the parent project manages the lockfile. https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
Without this, TypeScript silently falls back to including source files from referenced projects when their ts_out hasn't been built, generating stray .d.ts/.d.ts.map files in the wrong project's output directory. With this flag, TypeScript errors immediately instead, making missing project references obvious. https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
…hST' into claude/check-repo-access-kohST
IAgentOutput: - Remove default implementations; move them all to NullAgentOutput AgentSkillSubSkillEmbedded.Skill: - Changed from Lite<AgentSkillEntity> to [ImplementedBy] Lite<Entity> so a sub-skill can be an AgentSkillEntity (customised) or an AgentSkillCodeEntity (default, no DB entity required) DefaultRoots registry: - AgentSkillLogic.RegisterDefaultRoot(useCase, factory) registers a Func<AgentSkillCode> used as fallback when no DB entity exists for that use case, and as the source for ConstructFromUseCase - RootsByUseCase falls back to factory if no active entity found in DB AgentSkillOperation.CreateFromUseCase: - ConstructFrom<AgentUseCaseSymbol>: calls the registered factory, converts the code tree to AgentSkillEntity/AgentSkillCodeEntity references (NeedsEntity decides per node), saves child entities AgentSkillPropertyAttribute.ConvertValueToString: - Reverse of ConvertFromString; used by NeedsEntity to detect non-default property values when converting a factory tree to DB AgentSkillCode.WithSubSkill(): - Fluent builder for constructing default trees in factory functions https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
IsDefault() checks no sub-skills, no instructions/description overrides, and no property overrides — the entity-side equivalent of NeedsEntity(). NeedsEntity now compares OriginalInstructions directly instead of using the removed HasCustomInstructions flag. https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
AgentSkillCode.IsDefault() checks no sub-skills, unmodified short description, unmodified instructions, and all [AgentSkillProperty] values at their defaults. NeedsEntity() becomes a one-liner: !code.IsDefault(). https://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb
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.
Summary
AgentSkillEntity— DB-backed tree of skill instances. Each node hasName,SkillCode(links to a registeredAgentSkillCodeclass),Active,UseCase(AgentUseCaseSymbol:DefaultChatbot/Summarizer), optionalShortDescriptionandInstructionsoverrides,PropertyOverrides(MList), andSubSkills(MList defining the hierarchy). The tree is now exclusively DB-driven; no deployment needed to change skill configuration.AgentSkillCode— renamed fromAgentSkill. Tree API removed. Registered viaAgentSkillLogic.RegisterCode<T>().AgentSkillPropertyAttribute/AgentSkillProperty_QueryListAttribute— marks overridable properties on skill code classes with customConvertFromStringlogic.ResolvedSkillNode— runtime tree combining entity + code, built from DB and cached viaGlobalLazy(invalidated on entity changes). HasGetInstruction,FindSkill,FindTool,GetTools*.DirectedGraph.FeedbackEdgeSet(same pattern asRoleEntity).IAgentOutputinterface with no-op defaults;HttpAgentOutputimplements it for streaming. The agent loop is extracted toChatbotLogic.RunAgentLoopAsyncand can run without an HTTP connection.ChatbotLogic.RunHeadlessAsync— creates a session and runs the full agent loop headlessly (background jobs, tests, scheduled tasks)./api/agentSkill/registeredCodes,skillCodeDefaults/{code},skillCodeProperties/{code}.AgentSkillClient.tsx— registry (registerPropertyValueControl(attributeName, factory)) for custom property value editors.Templates/AgentSkill.tsx— entity template withMarkdownLine,LinkButtontoggling between editor andDiffDocument(code default vs. DB override), dynamic property override controls, and sub-skills table.Test plan
GET /api/agentSkill/registeredCodesreturns themAgentSkillEntitywithUseCase = DefaultChatbotand verify chatbot uses its instructionsInstructionson an entity and confirm the diff view shows changes vs. code defaultChatbotLogic.RunHeadlessAsyncfrom a background context and verify it completes without HTTPhttps://claude.ai/code/session_01DzaiFG2j85WBup5bdszYFb