Skip to content

docs(#6424): add Timeout() / context.DeadlineExceeded pitfall to Go guidelines - #6427

Merged
rh-hemartin merged 1 commit into
mainfrom
agent/6424-go-timeout-pitfall
Aug 26, 2026
Merged

docs(#6424): add Timeout() / context.DeadlineExceeded pitfall to Go guidelines#6427
rh-hemartin merged 1 commit into
mainfrom
agent/6424-go-timeout-pitfall

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

Adds a "Go pitfalls" section to docs/contributing/go-code.md documenting that context.DeadlineExceeded implements interface{ Timeout() bool } (returning true), so timeout detection via interface assertion must guard against context errors first. Without the guard, context deadline errors are incorrectly classified as transient and retried.

Related Issue

Closes #6424

Changes

  • Added new "Go pitfalls" section after "Error handling and naming conventions" in docs/contributing/go-code.md
  • Documented the Timeout() bool / context.DeadlineExceeded interface trap with WRONG and CORRECT code examples
  • Explained why context deadline/cancellation errors should never be retried
  • Referenced forge.IsTransient as the canonical correct pattern
  • Added review guideline for flagging unguarded Timeout() checks as medium-severity findings
  • Follows the pitfall documentation pattern from cel-triggers.md and shell-scripting.md

Testing

  • Documentation-only change — no Go production code modified
  • No tests required (no behavioral changes)
  • gitlint passes on commit message

Closes #6424

Post-script verification

  • Branch is not main/master (agent/6424-go-timeout-pitfall)
  • Secret scan passed (gitleaks — b294e1eaab74f8174dda7c556cad7e0508f6d9eb..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

…uidelines

Add a "Go pitfalls" section to docs/contributing/go-code.md documenting
that context.DeadlineExceeded implements interface{ Timeout() bool }
(returning true), so any timeout detection via interface assertion must
guard against context errors first. Without the guard, context deadline
errors are incorrectly classified as transient network timeouts and
retried.

The section includes WRONG/CORRECT code examples, explains why context
errors should never be retried, references forge.IsTransient as the
canonical correct pattern, and adds a review guideline for flagging
unguarded Timeout() checks.

This follows the existing pitfall documentation pattern established in
cel-triggers.md and shell-scripting.md.

Note: pre-commit could not run (sandbox network policy blocked git
fetch during hook initialization). The post-script runs pre-commit
authoritatively on the runner.

Closes #6424
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 20, 2026 18:00
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Aug 20, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 20, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:02 PM UTC · Completed 6:10 PM UTC

Commit: f9df829 · View workflow run →

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://896f39bb-site.fullsend-ai.workers.dev

Commit: f9df82999b550c95d21c42b8436d9f7d4c5c109f

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label Aug 20, 2026
@rh-hemartin
rh-hemartin added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit 5ae43cf Aug 26, 2026
65 of 66 checks passed
@rh-hemartin
rh-hemartin deleted the agent/6424-go-timeout-pitfall branch August 26, 2026 12:16
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 26, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 12:18 PM UTC · Completed 12:26 PM UTC

Commit: f9df829 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $1.36

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6427 — Go Timeout pitfall documentation

This PR documents the Timeout() bool / context.DeadlineExceeded interface trap in docs/contributing/go-code.md. It was generated end-to-end by the agent pipeline: a retro agent finding from PR #6217issue #6424 → triage → code → review → human merge.

Timeline

Time (UTC) Event
Aug 20, 17:48 Retro agent files #6424 from PR #6217 analysis
Aug 20, 17:50–17:53 Triage agent runs (~3 min): labels documentation, go, priority/medium, ready-to-code
Aug 20, 17:55–18:00 Code agent runs (~5 min): single commit, +34 lines to go-code.md
Aug 20, 18:00 PR created, ready-for-review label applied
Aug 20, 18:02–18:10 Review agent runs (~8 min): 3 sub-agents (correctness, style-conventions, intent-coherence), zero findings, APPROVED
Aug 26, 12:15 Human reviewer approves (6 days later)
Aug 26, 12:16 Merged via merge queue

Assessment

This workflow went well. The retro→triage→code→review pipeline completed in ~22 minutes with zero rework. The code agent produced technically accurate documentation on the first attempt, following existing pitfall patterns from cel-triggers.md and shell-scripting.md. The review agent's three sub-agents correctly verified the Go code examples, documentation structure consistency, and scope alignment with issue #6424. The human reviewer approved without additional comments — zero delta between agent and human review.

Evidence for existing issues (no new proposals needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document Timeout() interface / context.DeadlineExceeded pitfall in Go coding guidelines

1 participant