fix: Update decode_raw_input.py to pass ruff lint in consumer repos#235
fix: Update decode_raw_input.py to pass ruff lint in consumer repos#235
Conversation
- Use ternary operator instead of if-else block (SIM108) - Use modern type annotations: list, dict, tuple instead of List, Dict, Tuple (UP006) Consumer repos like Travel-Plan-Permission have stricter ruff configs that flagged these issues during the sync PR CI.
|
Status | ✅ no new diagnostics |
There was a problem hiding this comment.
Pull request overview
This PR updates .github/scripts/decode_raw_input.py to comply with stricter ruff linting rules used in consumer repositories. The changes are purely stylistic and maintain the same functionality while adhering to modern Python type annotation standards and simpler control flow patterns.
- Replaced typing module classes (List, Dict, Tuple) with modern built-in generic types (list, dict, tuple)
- Simplified conditional assignment using a ternary operator instead of if-else block
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Automated Status SummaryHead SHA: 60a269b
Coverage Overview
Coverage Trend
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScope
Tasks
Acceptance criteria
|
🤖 Keepalive Loop StatusPR #235 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
When all tasks were complete but Gate was failing (e.g., lint-ruff), the keepalive loop would stop after `complete_gate_failure_rounds` reached its max, without giving fix attempts a fair chance. Three interacting issues caused this: 1. The `complete-gate-failure-max` check fired BEFORE the fix classification logic in the decision tree, blocking fix attempts once the counter reached the max. 2. Transient gate states (cancelled) incremented the counter even though they don't represent actual fix failures, consuming the fix budget with infrastructure noise. 3. The `consecutive_fix_rounds` counter was reset on wait/stop actions, losing track of prior fix attempts. Changes: - Restructure evaluate decision tree: handle cancelled gates first (without consuming fix budget), then try fix before stopping when all tasks complete and gate failing - Only increment complete_gate_failure_rounds on actual agent execution rounds (fix/run/conflict), not on wait/skip/stop - Preserve consecutive_fix_rounds across wait/stop/defer actions (only reset on non-fix agent execution) - Increase default completeGateFailureMax from 2 to 3, allowing 2 fix attempts before stopping - Add 10 focused tests for counter behavior Fixes the issue seen in Counter_Risk PR #235 where the agent completed all 27 tasks but stopped with complete-gate-failure-max despite lint-ruff failures that could have been fixed. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
* fix: correct tasksTotal falsy check and stale iteration in keepalive loop - Use nullish coalescing (??) instead of logical OR (||) for tasksTotal in work-log table rows so that 0 displays as "0" instead of "?" - Use previousState?.iteration ?? iteration instead of bare iteration in rounds_without_task_completion recalculation to stay consistent with the "current persisted iteration" rule (line 2739-2741) Both fixes address review feedback from Copilot on Counter_Risk PR #234. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL * fix: prevent keepalive from stopping without fixing CI failures When all tasks were complete but Gate was failing (e.g., lint-ruff), the keepalive loop would stop after `complete_gate_failure_rounds` reached its max, without giving fix attempts a fair chance. Three interacting issues caused this: 1. The `complete-gate-failure-max` check fired BEFORE the fix classification logic in the decision tree, blocking fix attempts once the counter reached the max. 2. Transient gate states (cancelled) incremented the counter even though they don't represent actual fix failures, consuming the fix budget with infrastructure noise. 3. The `consecutive_fix_rounds` counter was reset on wait/stop actions, losing track of prior fix attempts. Changes: - Restructure evaluate decision tree: handle cancelled gates first (without consuming fix budget), then try fix before stopping when all tasks complete and gate failing - Only increment complete_gate_failure_rounds on actual agent execution rounds (fix/run/conflict), not on wait/skip/stop - Preserve consecutive_fix_rounds across wait/stop/defer actions (only reset on non-fix agent execution) - Increase default completeGateFailureMax from 2 to 3, allowing 2 fix attempts before stopping - Add 10 focused tests for counter behavior Fixes the issue seen in Counter_Risk PR #235 where the agent completed all 27 tasks but stopped with complete-gate-failure-max despite lint-ruff failures that could have been fixed. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL * chore: sync template scripts * fix: address review comments on PR #1651 1. Fix infinite wait loop for non-fixable gate failures: remove `isAgentExecution` requirement from counter increment — the `gateActuallyFailed` check already filters transient states (cancelled/pending), so the counter advances on every genuine failure round regardless of action type. 2. Sync template keepalive_loop.js with all main file changes: - Restructured evaluate decision tree (cancelled → allComplete → remaining) - Updated counter logic (increment on actual failure, preserve on non-success) - Fix round preservation across wait/stop/defer actions - Default completeGateFailureMax 2 → 3 3. Add test for the non-fixable wait+failure scenario; update stop-action test expectation to match new counter semantics. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL * fix: update test to expect gate-cancelled-transient reason The cancelled gate test expected 'gate-cancelled' but the code now returns 'gate-cancelled-transient' for non-rate-limit cancellations. Updated the assertion to match. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Automated Status Summary
Scope
Tasks
Acceptance criteria
Head SHA: beebaeb
Latest Runs: ⏳ queued — Gate
Required: gate: ⏳ queued