-
Notifications
You must be signed in to change notification settings - Fork 7
Add agentic workflow to test large payload storage and agent access #730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@copilot make the programmatically created large file even larger, like 500kb |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
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 adds an agentic workflow to test the MCP Gateway's jqschema middleware, which intercepts MCP tool responses, stores them to disk, and returns metadata to enable agent access to large payloads. The workflow uses a secret-based verification approach where a UUID is embedded in a ~500KB test file, then the agent reads the file through the filesystem MCP server, retrieves the payload via gateway metadata, and verifies the secret matches.
Changes:
- Adds
.github/workflows/large-payload-tester.mdwith workflow definition, bash setup script, and volume mount configuration - Adds
.github/agentics/large-payload-tester.mdwith agent test protocol and instructions - Adds
.github/workflows/large-payload-tester-README.mddocumenting the test architecture and implementation details - Generates
.github/workflows/large-payload-tester.lock.ymlcompiled GitHub Actions workflow
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/large-payload-tester.md | Workflow definition with frontmatter, bash setup to generate test files with embedded secrets, and volume mount configuration for test data and payload access |
| .github/workflows/large-payload-tester.lock.yml | Compiled GitHub Actions workflow with agent, detection, safe_outputs, and conclusion jobs |
| .github/workflows/large-payload-tester-README.md | Architecture documentation explaining test protocol, volume mounts, path translation, and expected behavior |
| .github/agentics/large-payload-tester.md | Agent prompt with step-by-step test instructions for reading secrets, triggering large payloads, accessing stored files, and reporting results |
Comments suppressed due to low confidence (1)
.github/workflows/large-payload-tester-README.md:6
- The description states the middleware intercepts "large responses (>500 chars)" but this is misleading. Based on the actual implementation in internal/middleware/jqschema.go (lines 130-232), the middleware is applied to ALL successful tool responses regardless of size. The 500 character threshold only determines whether the preview is truncated, not whether the middleware is applied.
All responses are:
- Stored to disk (regardless of size)
- Transformed to include metadata (payloadPath, schema, preview, etc.)
- Have their preview truncated to 500 chars IF they exceed that length
The description should clarify that the middleware applies to all responses, not just large ones, and that 500 chars is the truncation threshold for the preview field.
1. **Payload Storage**: Verifies that large responses (>500 chars) are automatically stored to disk
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Test Results | ||
|
|
||
| 1. ✅/❌ Read test secret from control file | ||
| 2. ✅/❌ Trigger large payload response (>1KB) |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 120 describes step 2 as "Trigger large payload response (>1KB)" but this is inconsistent with the actual test design. The test file is ~500KB (not 1KB), and the middleware applies to all responses regardless of size. The ">1KB" threshold is not relevant to the actual implementation or test behavior.
This should either be removed or changed to reflect that the test file is ~500KB and the middleware processes all responses (with preview truncation at 500 characters).
| 2. ✅/❌ Trigger large payload response (>1KB) | |
| 2. ✅/❌ Trigger large payload response (~500KB; middleware processes all responses, preview truncated to 500 chars) |
| ## Related Features | ||
|
|
||
| This workflow tests the jqschema middleware feature. The related implementation files are: | ||
| - `internal/middleware/jqschema.go` - Middleware that intercepts large responses |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states "Middleware that intercepts large responses" but this is inaccurate. Based on the implementation in internal/middleware/jqschema.go, the middleware intercepts and processes ALL successful tool responses regardless of size. It always stores payloads to disk and returns metadata. The 500 character threshold only determines whether the preview is truncated, not whether the middleware is applied.
The comment should be clarified to say "Middleware that intercepts all responses" or "Middleware that processes tool responses and stores payloads".
| - `internal/middleware/jqschema.go` - Middleware that intercepts large responses | |
| - `internal/middleware/jqschema.go` - Middleware that processes tool responses and stores payloads |
| EOF | ||
|
|
||
| # Use jq to properly populate the JSON with dynamic values and generate large array | ||
| # Generating 2000 items + 400KB padding to create ~500KB file |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment says "Generating 2000 items + 400KB padding to create ~500KB file" but this calculation is imprecise. The 400KB padding alone is 400,000 bytes, and 2000 array items with the structure shown would add approximately 100-300KB more, resulting in a file that's likely 500-700KB in size, not exactly ~500KB.
While the validation at line 101 correctly checks for at least 512000 bytes, the comment could be more accurate. Consider updating to "Generating 2000 items + 400KB padding to create ~500-700KB file" or just "Generating 2000 items + 400KB padding to create a large test file (target >500KB)".
| # Generating 2000 items + 400KB padding to create ~500KB file | |
| # Generating 2000 items + 400KB padding to create a large test file (target >500KB) |
| 1. Gateway receives large response from filesystem server | ||
| 2. Gateway stores payload to: `/tmp/jq-payloads/{sessionID}/{queryID}/payload.json` | ||
| 3. Gateway returns metadata with `payloadPath` and `truncated: true` | ||
| 4. Agent reads payload from mounted path: `/workspace/mcp-payloads/session/{queryID}/payload.json` |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path in line 93 contains an extra "session/" component that doesn't match the actual payload storage structure. According to lines 88-91 and the rest of the documentation, the path structure is /tmp/jq-payloads/{sessionID}/{queryID}/payload.json where {sessionID} is the actual session identifier. Line 93 incorrectly shows /workspace/mcp-payloads/session/{queryID}/payload.json which adds an extra "session" directory that doesn't exist.
The path should be: /workspace/mcp-payloads/{sessionID}/{queryID}/payload.json (where {sessionID} is replaced with the actual session ID value)
| 4. Agent reads payload from mounted path: `/workspace/mcp-payloads/session/{queryID}/payload.json` | |
| 4. Agent reads payload from mounted path: `/workspace/mcp-payloads/{sessionID}/{queryID}/payload.json` |
| - Read `/workspace/test-data/test-secret.txt` to get the secret UUID that was generated for this test run | ||
| - This file contains ONLY the secret UUID (e.g., `abc123-def456-ghi789`) | ||
| - Store this secret - you'll need it to verify payload retrieval later |
Copilot
AI
Feb 5, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description states the secret file "contains ONLY the secret UUID" (line 28), but the actual implementation in the workflow file shows the secret is prefixed with "test-secret-" (lines 54, 56 in large-payload-tester.md). For example, the actual format is "test-secret-{uuid}" not just "{uuid}".
The example format "abc123-def456-ghi789" in line 28 also doesn't match the actual UUID format which would be something like "test-secret-550e8400-e29b-41d4-a716-446655440000" (if using uuidgen) or "test-secret-1708963200123456789-12345" (if using timestamp fallback).
This discrepancy could confuse the agent during testing since it needs to know the exact format to properly extract and compare the secret.
Tests the jqschema middleware's ability to intercept large MCP responses (>500 chars), store them to disk at
/tmp/jq-payloads/{sessionID}/{queryID}/payload.json, and enable agent retrieval via mounted volumes.Test Protocol
Secret-based verification:
payloadPath,schema,preview,truncated/tmp/jq-payloads→/workspace/mcp-payloads) and reads payloadTest File Details
jqfor proper JSON generation ensuring no shell injection risksVolume Mounts
Files
.github/workflows/large-payload-tester.md- workflow definition, bash setup.github/agentics/large-payload-tester.md- agent test protocol.github/workflows/large-payload-tester-README.md- architecture documentationSecurity
/workspace(not/workspace,/tmp)jq(no shell injection)Scheduling
Runs daily via scattered schedule. Manual trigger via
workflow_dispatch.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.