Skip to content

Fix Timeout type drift between BoundedQueriesConfig and AWFBoundedQueriesConfig - #53694

Merged
pelikhan merged 2 commits into
mainfrom
copilot/deep-report-fix-timeout-type-drift
Aug 18, 2026
Merged

Fix Timeout type drift between BoundedQueriesConfig and AWFBoundedQueriesConfig#53694
pelikhan merged 2 commits into
mainfrom
copilot/deep-report-fix-timeout-type-drift

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

BoundedQueriesConfig (yaml-tagged frontmatter shape) and AWFBoundedQueriesConfig (json-tagged AWF-config-file shape) are parallel structs for the bounded-query subsystem, but their Timeout fields had drifted: *int in one, int in the other. This risks silently mismatching nil-vs-zero timeout semantics for anyone converting between the two shapes.

Type alignment

  • Changed AWFBoundedQueriesConfig.Timeout from int to *int in pkg/workflow/awf_config.go, matching BoundedQueriesConfig.Timeout.
  • Simplified extractBoundedQueriesConfig to copy the pointer directly instead of dereferencing it, removing the manual nil-check that previously bridged the type mismatch.

Tests & docs

  • Updated pkg/workflow/bounded_queries_test.go to construct/assert Timeout as a pointer.
  • Updated the struct signature reference in pkg/workflow/README.md.
awfBQ := &AWFBoundedQueriesConfig{
    Enabled:     true,
    Runtime:     bq.Runtime,
    MemoryLimit: bq.MemoryLimit,
    Interpreter: bq.Interpreter,
    Timeout:     bq.Timeout, // pointer copied directly, no nil/zero ambiguity
}

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix timeout type drift between BoundedQueriesConfig and AWFBoundedQueriesConfig Fix Timeout type drift between BoundedQueriesConfig and AWFBoundedQueriesConfig Aug 18, 2026
Copilot AI requested a review from pelikhan August 18, 2026 13:07
@pelikhan
pelikhan marked this pull request as ready for review August 18, 2026 13:09
Copilot AI balanced review requested due to automatic review settings August 18, 2026 13:09
@github-actions

Copy link
Copy Markdown
Contributor

Looks great! This is a solid type-safety improvement.

Your fix elegantly resolves the Timeout field drift between BoundedQueriesConfig (using *int) and AWFBoundedQueriesConfig (previously int). By aligning both to use pointers, you've eliminated the nil-vs-zero ambiguity that could have silently caused incorrect timeout semantics downstream.

The changes are well-scoped:

  • ✅ Type alignment in awf_config.go
  • ✅ Simplified pointer copy in extractBoundedQueriesConfig
  • ✅ Updated test assertions in bounded_queries_test.go
  • ✅ Documentation reference updated in README.md

All tests are included, and the PR body clearly explains the motivation and impact. This is ready for review!

Generated by ✅ Contribution Check · auto · 50.5 AIC · ⌖ 5.19 AIC · ⊞ 9.2K ·

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns bounded-query timeout types to preserve nil-versus-zero semantics across frontmatter and generated AWF configuration.

Changes:

  • Changes AWFBoundedQueriesConfig.Timeout to *int.
  • Copies timeout pointers directly and updates tests.
  • Refreshes the documented struct signature.
Show a summary per file
File Description
pkg/workflow/awf_config.go Aligns timeout type and extraction logic.
pkg/workflow/bounded_queries_test.go Updates pointer assertions and JSON coverage.
pkg/workflow/README.md Updates the generated type reference.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship. This PR only aligns a Timeout field type from int to *int and simplifies extractBoundedQueriesConfig by removing a manual nil-check (net reduction in code). No over-engineering, dead flexibility, or unnecessary complexity found.

Generated by Ponytail Reviewer for #53694

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #53694 does not have the 'implementation' label and has only 9 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-18T00:00:00Z
review_event: COMMENT
top_themes:
  - timeout nil-vs-zero semantics aligned across config shapes
  - no blocking changed-line correctness issues found
files_reviewed:
  - pkg/workflow/awf_config.go
  - pkg/workflow/bounded_queries_test.go
  - pkg/workflow/README.md
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 7.01 AIC · ⌖ 6.79 AIC · ⊞ 4.5K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict

Comment only: this change looks mechanically correct and I did not find a blocking regression in the touched lines.

Notes

I checked the timeout pointer alignment in the AWF config struct, the direct pointer copy in extractBoundedQueriesConfig, and the updated tests/docs. The nil-vs-zero behavior now matches the frontmatter shape, and I did not find a changed-line correctness issue worth blocking on.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 7.01 AIC · ⌖ 6.79 AIC · ⊞ 4.5K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

The change correctly aligns AWFBoundedQueriesConfig.Timeout from int to *int, matching BoundedQueriesConfig.Timeout and preserving nil-vs-zero semantics so an omitted timeout is faithfully round-tripped through JSON.

One blocking issue: new(30) on line 610 of bounded_queries_test.go is invalid Go syntax — new accepts a type, not a value literal. This will not compile. A local variable (timeout := 30; &timeout) or a package ptr helper should be used instead.

Everything else (README update, extractBoundedQueriesConfig simplification, test assertions) looks correct.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 22.8 AIC · ⌖ 8.87 AIC · ⊞ 5.7K

},
Runtime: BoundedQueryRuntimeSbx,
Timeout: 30,
Timeout: new(30),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new(30) is not valid Go — new takes a type, not a value. This will fail to compile.

Use a local variable or a helper instead:

// option 1
timeout := 30
Timeout: &timeout,

// option 2 (if a ptr helper exists in the package)
Timeout: ptr(30),

@copilot please address this.

@github-actions github-actions Bot mentioned this pull request Aug 18, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs — requesting changes for a compile error introduced in the test file.

📋 Key Themes & Highlights

Key Themes

  • Compile error in test: Timeout: new(30) on line 610 of bounded_queries_test.gonew takes a type, not an integer literal. This will prevent the test package from compiling.

Positive Highlights

  • ✅ Core fix is correct: AWFBoundedQueriesConfig.Timeout int → *int eliminates nil-vs-zero ambiguity
  • ✅ Removing the explicit nil-check in extractBoundedQueriesConfig simplifies the code nicely
  • ✅ Tests correctly updated to use require.NotNil + pointer dereference and assert.Nil for the zero-value case
  • ✅ README struct signature updated to stay in sync

Skill selection used fallback heuristic — triage unavailable; PR title contains "Fix" so /diagnosing-bugs was selected.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 80.1 AIC · ⌖ 9.94 AIC · ⊞ 7.8K
Comment /matt to run again

},
Runtime: BoundedQueryRuntimeSbx,
Timeout: 30,
Timeout: new(30),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] new(30) is not valid Go — new is a builtin that takes a type, not a value literal. This line will fail to compile.

💡 Suggested fix

Use an address-of with a temporary variable, consistent with pkg/workflow/compiler_safe_outputs_steps_test.go:

timeout := 30
Timeout: &timeout,

Or add a small package-level helper (as done in checkout_manager_test.go):

ptr := func(n int) *int { return &n }
// ...
Timeout: ptr(30),

Note: new(30) also appears on earlier lines (87, 191, 271) of this file for BoundedQueriesConfig.Timeout — those are pre-existing and should be addressed in a follow-up. This PR introduces one new occurrence on this line.

@copilot please address this.

@pelikhan
pelikhan merged commit bc8b39c into main Aug 18, 2026
105 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-fix-timeout-type-drift branch August 18, 2026 14:43
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Fix Timeout type drift: BoundedQueriesConfig (*int) vs AWFBoundedQueriesConfig (int)

3 participants