MCPcopy Create free account
hub / github.com/github/gh-aw / main

Function main

actions/setup/js/detect_agent_errors.cjs:130–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128}
129
130function main() {
131 let logContent = "";
132
133 if (fs.existsSync(LOG_FILE)) {
134 logContent = fs.readFileSync(LOG_FILE, "utf8");
135 } else {
136 process.stderr.write(`[detect-agent-errors] Log file not found: ${LOG_FILE}\n`);
137 }
138
139 const results = detectErrors(logContent);
140
141 if (results.inferenceAccessError) {
142 process.stderr.write("[detect-agent-errors] Detected inference access error in agent log\n");
143 }
144 if (results.mcpPolicyError) {
145 process.stderr.write("[detect-agent-errors] Detected MCP policy error in agent log\n");
146 }
147 if (results.agenticEngineTimeout) {
148 process.stderr.write("[detect-agent-errors] Detected timeout: engine process was killed by signal (step timeout-minutes likely exceeded)\n");
149 }
150 if (results.modelNotSupportedError) {
151 process.stderr.write("[detect-agent-errors] Detected model configuration error: configured model is invalid or unavailable for this engine/account\n");
152 }
153 if (results.http400ResponseError) {
154 process.stderr.write("[detect-agent-errors] Detected HTTP 400 response error in agent log\n");
155 }
156 if (results.capiQuotaExceededError) {
157 process.stderr.write("[detect-agent-errors] Detected CAPI quota exhaustion: Copilot quota has been exceeded\n");
158 }
159
160 writeOutputs(results);
161}
162
163if (require.main === module) {
164 main();

Callers 1

Calls 2

detectErrorsFunction · 0.85
writeOutputsFunction · 0.85

Tested by

no test coverage detected