Add support for safe-inputs front matter section#5090
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot continue work |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Continued work on safe-inputs. In commit 1e1e43b, I've integrated the safe-inputs MCP server into workflow compilation:
The implementation now generates a working MCP server that exposes custom tools to the agent. Unit tests for safe-inputs parsing and generation are still pending. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ration Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add support for importing safe-inputs tool from shared agentic workflows. Add a shared agentic workflow that uses gh PRs to download PR data using a shell script. Use that workflow with dev.md to compute basic PR stats |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added safe-inputs import support in commit 63e918c. Created The agent can now use |
|
@copilot add special handling for large tool outputs. If larger than 500 chars,
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added large output handling in commit 91c65f4. Tool outputs > 500 chars are written to |
|
@copilot when the file is too large return a structure response to the LLM that clearly states where the output response file path is, file size and attempt to run "jq" to extract a simplified JSON schema. |
|
@copilot the javascript should always be wrapped into a function with modules.exports assignment so that the user can simplify write code without worrying about exports. |
|
…and JSON schema preview Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in commit 6adf6bd. When output exceeds 500 chars, the response now includes:
|
|
/q investigate #5090 (comment) If the error is not clear, update dev.md to use codex for better error messages. |
|
🔧 Pay attention, 007! Q is preparing your gadgets for this issue comment... |
🔧 Q Investigation Report - MCP Server Launch FailureIssue AnalysisI investigated the Dev workflow failure (run #19791426012) reported by Dev Hawk. Root CauseThe workflow failed with: This failure occurred during log parsing (step 34) after the Claude agent had already completed its execution successfully. Key Findings
Investigation DetailsWhat I Checked:
Observations:
Recommended Actions1. Fix the Safe-Inputs MCP Server ImplementationThe issue is in the safe-inputs MCP server generation code (likely in the PR changes). The server needs to:
Files to Check:
2. Consider Engine Change for Dev WorkflowAs suggested by - engine: claude
+ engine: codexPros:
Cons:
3. Add MCP Server ValidationAdd validation that checks if safe-inputs MCP server can launch before the agent starts:
Why Not Creating a PRThe actual bug is in the safe-inputs implementation code (within this PR's changes), not in the workflow configuration. The fix needs to happen at the compiler/code-generation level where the safe-inputs MCP server is created. What I Would Fix If I Had Access:
Next StepsFor the PR author to fix:
|
|
@copilot update dev.md to use codex, add test cases in JavaScript to discover the error. |
…ev.md to use codex with JS test cases Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in commit b749805. JavaScript code is now automatically wrapped in a function with const sum = a + b;
return { sum };Instead of: module.exports = async function(params) {
const { a, b } = params;
return { sum: a + b };
};
Updated dev.md to use Codex engine and added JavaScript test cases in commit b749805. The workflow now includes:
|
✅ Dev Hawk Report - SuccessWorkflow Run: #3020
SummaryThe Dev workflow completed successfully! 🎉 All checks passed for the safe-inputs feature implementation. Workflow Details:
This validates the changes made to add support for the
The workflow successfully validated the implementation with JavaScript test cases. 🚀
|
|
@copilot add documentation page |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added documentation page in commit 55fa0ab at
|
|
@copilot format, lint, fix all tests |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Adds a new
safe-inputsfront matter section that provides a way to register custom tools as JavaScript or shell scripts. These tools are mounted in an MCP server and have access to secrets as specified by the user.Changes Made
safe-inputsproperty definition inmain_workflow_schema.jsonandincluded_file_schema.jsonwith validation for tool configurations (description required, script/run mutually exclusive)SafeInputsConfigtype andParseSafeInputsfunction insafe_inputs.goenvfield are properly passed through to the MCP serverMergedSafeInputstoImportsResultand implementedmergeSafeInputsfor importing safe-inputs from shared workflowsmodule.exports. Input parameters are destructured and available as local variables, so users can write simple code without worrying about exports./tmp/gh-aw/safe-inputs/calls/directory. The response now includes:status: "output_saved_to_file"file_path: Path to the saved output filefile_size_bytes: Size of the file in bytesfile_size_chars: Size of the file in charactersmessage: Human-readable descriptionjson_schema_preview: (optional) Simplified JSON schema extracted usingjqif the output is JSONdocs/src/content/docs/reference/safe-inputs.mdNew Files
shared/pr-data-safe-input.md- Shared workflow providingfetch-pr-datatool using gh CLIdocs/src/content/docs/reference/safe-inputs.md- Documentation for safe-inputs featureUsage Example
Define a safe-input tool (simplified - no exports needed!)
Import safe-inputs from shared workflows
Testing
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.