Skip to content

Remove unsupported docker-image field from cache-memory schema#3597

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-schema-parser-mismatch
Nov 11, 2025
Merged

Remove unsupported docker-image field from cache-memory schema#3597
pelikhan merged 3 commits into
mainfrom
copilot/fix-schema-parser-mismatch

Conversation

Copilot AI commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

The docker-image field was defined in cache-memory schemas but not implemented in the parser, causing user configurations to be silently ignored.

Changes

  • Schemas: Removed docker-image property from both main_workflow_schema.json and included_file_schema.json
  • Tests: Added validation test for docker-image rejection; updated existing test to use only implemented fields
  • Docs: Removed docker-image from frontmatter reference documentation

Result

Schema now correctly rejects unsupported field:

tools:
  cache-memory:
    docker-image: "custom/memory:latest"  # ✗ error: Unknown property: docker-image
    key: "custom-key"                      # ✓ valid
    retention-days: 7                      # ✓ valid
    description: "Cache description"       # ✓ valid

Resolves schema-parser mismatch per #3589.

Original prompt

This section details on the original issue you should resolve

<issue_title>[task] Fix critical schema-parser mismatch: cache-memory docker-image field not implemented</issue_title>
<issue_description>## Objective
Resolve the critical mismatch where cache-memory.docker-image is defined in the JSON schema but completely missing from the Go parser implementation, making this advertised feature non-functional.

Context

The schema consistency check (discussion #3589) discovered that users can configure a custom Docker image for the cache-memory MCP server in their workflow YAML, but this configuration is silently ignored because the parser doesn't implement it.

Current State:

  • Schema advertises the feature at pkg/parser/schemas/main_workflow_schema.json:2041
  • Parser struct in pkg/workflow/cache.go:19-24 omits the DockerImage field entirely
  • Users' configurations pass validation but don't work

Approach

Option A: Implement the feature (recommended if docker-image customization is needed)

  1. Add DockerImage string \yaml:"docker-image,omitempty"`to theCacheMemoryEntrystruct inpkg/workflow/cache.go`
  2. Update the extractCacheMemoryConfig function to handle the docker-image configuration
  3. Modify cache-memory MCP server generation code to use the custom image when specified
  4. Add validation to ensure the docker-image value is a valid image reference

Option B: Remove from schema (if feature is not intended)

  1. Remove the docker-image property from the cache-memory schema definition
  2. Document why this feature is not supported

Files to Modify

If implementing:

  • pkg/workflow/cache.go - Add DockerImage field to CacheMemoryEntry struct
  • pkg/workflow/cache.go - Update extractCacheMemoryConfig function
  • pkg/workflow/mcp_servers.go - Update MCP server generation to use custom image
  • pkg/workflow/cache_test.go - Add test coverage for docker-image configuration

If removing:

  • pkg/parser/schemas/main_workflow_schema.json - Remove docker-image property from cache-memory definition

Acceptance Criteria

  • Decision made: implement feature OR remove from schema
  • If implementing: DockerImage field added to struct with proper yaml tag
  • If implementing: Custom docker images are used when configured
  • If implementing: Tests verify docker-image configuration works correctly
  • If removing: Schema no longer advertises unsupported feature
  • Schema validation and parser implementation are aligned

Related Documentation

AI generated by Plan Command for discussion #3589</issue_description>

Comments on the Issue (you are @copilot in this section)

@pelikhan @copilot remove from schema.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 11, 2025 03:06
The docker-image field was defined in the JSON schema but not implemented
in the Go parser (CacheMemoryEntry struct). This caused a mismatch where
users could configure docker-image in their workflows, but the setting
was silently ignored.

Per @pelikhan's directive, removing the field from the schema to align
with the actual implementation rather than implementing the feature.

Changes:
- Removed docker-image property from cache-memory object schema
- Schema now correctly reflects supported fields: key, description, retention-days
- Validation now properly rejects docker-image configuration
- All existing tests pass

Testing:
- Verified schema rejects docker-image field with clear error message
- Verified valid cache-memory configurations still work (object and array notation)
- All unit tests pass (make test)
- All linting passes (make lint)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Complete removal of the docker-image field from cache-memory configuration:

1. Removed from included_file_schema.json (used for imported workflow files)
2. Updated schema_test.go:
   - Changed "all options" test to use valid fields only (key, retention-days, description)
   - Added explicit test case to verify docker-image is rejected
   - Fixed error message assertion for included file schema
3. Removed from documentation (frontmatter-full.md)

All changes ensure schema and parser are fully aligned:
- Both main and included file schemas reject docker-image
- Tests verify rejection with appropriate error messages
- Documentation no longer advertises unsupported feature

Verification:
✅ Schema rejects docker-image with clear error:
   "additional properties 'docker-image' not allowed"
✅ All unit tests pass (make test)
✅ All linting passes (make lint)
✅ Manual compilation tests confirm rejection works

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix critical schema-parser mismatch for cache-memory docker-image Remove unsupported docker-image field from cache-memory schema Nov 11, 2025
Copilot AI requested a review from pelikhan November 11, 2025 03:18
@pelikhan pelikhan marked this pull request as ready for review November 11, 2025 03:21
Copilot AI review requested due to automatic review settings November 11, 2025 03:21
@pelikhan pelikhan merged commit 00d719b into main Nov 11, 2025
78 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR resolves a schema-parser mismatch by removing the docker-image field from cache-memory schemas. The field was defined in the JSON schemas but never implemented in the Go parser (CacheMemoryEntry struct), causing user configurations to be silently ignored.

Key Changes:

  • Removed docker-image property definition from both schema files
  • Added validation test to ensure docker-image is properly rejected
  • Updated existing test to use only implemented fields (description instead of docker-image)
  • Updated documentation to remove references to the unsupported field

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/parser/schemas/main_workflow_schema.json Removed docker-image property from cache-memory object schema definition
pkg/parser/schemas/included_file_schema.json Removed docker-image property from cache-memory object schema definition
pkg/parser/schema_test.go Added test for docker-image rejection; updated existing test to use implemented fields only
docs/src/content/docs/reference/frontmatter-full.md Removed docker-image documentation from cache-memory section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pelikhan pelikhan deleted the copilot/fix-schema-parser-mismatch branch November 11, 2025 03:23
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.

[task] Fix critical schema-parser mismatch: cache-memory docker-image field not implemented

3 participants