Refactor schema system: pass ParsedActionSchema in-memory instead of re-reading files#2015
Merged
curtisman merged 2 commits intomicrosoft:mainfrom Mar 17, 2026
Merged
Refactor schema system: pass ParsedActionSchema in-memory instead of re-reading files#2015curtisman merged 2 commits intomicrosoft:mainfrom
curtisman merged 2 commits intomicrosoft:mainfrom
Conversation
…re-reading files Rename manifest fields back to original convention: - compiledSchemaFile -> schemaFile (points to .pas.json compiled format) - schemaFile -> originalSchemaFile (points to .ts source for legacy code paths) Eliminate redundant file I/O throughout the schema pipeline: - enrichGrammarWithCheckedVariables now accepts ParsedActionSchema directly instead of loading from a file path - Grammar generation callback returns ParsedActionSchema from the already-loaded actionSchemaFileCache instead of resolving file paths - Schema text for MCP server is generated from parsed schema via generateSchemaTypeDefinition instead of reading .ts files from disk - AgentSubSchemaInfo uses schemaText (generated) instead of schemaFilePath Add getSchemaInfoFromParsedSchema to actionGrammar for extracting SchemaInfo from an in-memory ParsedActionSchema, with loadSchemaInfo refactored to use it. Use proper ParsedActionSchema typing in agent-cache instead of 'any'. Make schema paths in manifests relative to the package directory and document path resolution behavior in agentInterface.ts.
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
Refactors the schema pipeline to pass already-loaded
ParsedActionSchemaobjects in-memory instead of repeatedly reading.pas.jsonand.tsfiles from disk.Changes
Manifest field naming
compiledSchemaFile→schemaFile(points to compiled.pas.json)schemaFile→originalSchemaFile(points to.tssource for legacy code paths)agentInterface.tsEliminate redundant file I/O
enrichGrammarWithCheckedVariablesnow acceptsParsedActionSchemadirectly instead of loading from a file pathconfigureGrammarGeneration) returnsParsedActionSchemafrom the in-memoryactionSchemaFileCacheinstead of resolving file paths on diskgenerateSchemaTypeDefinitioninstead of reading.tsfiles from diskAgentSubSchemaInfousesschemaText(generated from PAS) instead ofschemaFilePathNew API
getSchemaInfoFromParsedSchema()toactionGrammarfor extractingSchemaInfofrom an in-memoryParsedActionSchema, withloadSchemaInforefactored to delegate to itType safety
ParsedActionSchematyping inagent-cacheinstead ofanyFiles changed (28)
actionConfig.ts,agentInterface.ts,schemaReader.ts,generation/index.tsgrammarMetadata.ts,appAgentManager.tsdispatcher.ts,commandHandlerContext.ts,dispatcherTypes,agentTranslators.tscache.ts,grammarIntegration.spec.tscommandServer.tsnpmAgentProvider.ts