Skip to content

fix(ci): update actions/cache to v4 in benchmarks workflow - #224

Merged
KooshaPari merged 2 commits into
mainfrom
fix/benchmarks-cache-v4
Sep 1, 2026
Merged

fix(ci): update actions/cache to v4 in benchmarks workflow#224
KooshaPari merged 2 commits into
mainfrom
fix/benchmarks-cache-v4

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Sep 1, 2026

Copy link
Copy Markdown
Owner

User description

GitHub deprecated actions/cache v1/v2 and auto-fails workflows using them. Update the SHA to actions/cache@v4.


CodeAnt-AI Description

Add end-to-end agent-loop coverage and restore benchmark caching

What Changed

  • Added 19 mock-provider tests covering tool calls, multi-turn interactions, provider fallback, stream failures, context compaction, concurrent requests, usage tracking, serialization, message ordering, and iteration limits
  • Updated the benchmark workflow to use the current cache action so benchmark jobs continue running instead of failing due to deprecated cache versions

Impact

✅ Fewer agent-loop regressions
✅ Reliable provider fallback tests
✅ Benchmark workflows continue using build caches

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Copilot AI lite review requested due to automatic review settings September 1, 2026 04:18
@codeant-ai

codeant-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 05ebf56 Sep 01, 2026 · 04:18 04:21

@codeant-ai

codeant-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai codeant-ai Bot added the size:XL label Sep 1, 2026
@mergify mergify Bot added the rust label Sep 1, 2026
@socket-security

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05ebf569c8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +179 to +183
/// Simulates the core agent loop pattern that forge_api orchestrates.
struct AgentLoop {
providers: Vec<MockProvider>,
max_iterations: usize,
tool_executor: Box<dyn Fn(&ToolCallFull) -> String + Send + Sync>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exercise the production agent loop

The agent-loop tests invoke this test-only AgentLoop, which independently implements provider fallback, iteration limits, context updates, and tool execution instead of calling the production ForgeApp::chat/Orchestrator::run path. Consequently, regressions in the real orchestration can leave every purported end-to-end scenario green; use mocked production service traits to drive the actual orchestrator rather than maintaining a parallel implementation in an integration-test file.

AGENTS.md reference: AGENTS.md:L40-L42

Useful? React with 👍 / 👎.

Comment on lines +510 to +512
for (i, answer, iterations) in results {
assert_eq!(answer, format!("Response for conversation {i}"));
assert_eq!(iterations, 1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Isolate each concurrent request's response queue

When Tokio schedules these spawned tasks in any order other than their creation order, each task removes the next item from one shared FIFO queue, so conversation i is not guaranteed to receive response i; sorting the completed tuples afterward cannot restore that association, and this assertion fails nondeterministically under concurrent scheduling. Give each request an isolated provider/response or assert only order-independent properties.

Useful? React with 👍 / 👎.

Comment on lines +633 to +635
provider.push_response(MockResponse::text_with_usage("Turn 1", 100)).await;
provider.push_response(MockResponse::text_with_usage("Turn 2", 200)).await;
provider.push_response(MockResponse::text_with_usage("Turn 3", 150)).await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Drive all configured turns before checking accumulated usage

Each queued response is plain text with no tool calls, so AgentLoop::run returns immediately after consuming only Turn 1; the 200- and 150-token responses remain unused, and the weak > 0 assertion passes without testing accumulation across turns. Exercise all three responses through the same context and compare the resulting total with the handwritten expected value of 450 tokens.

AGENTS.md reference: AGENTS.md:L18-L22

Useful? React with 👍 / 👎.

Comment on lines +180 to +184
struct AgentLoop {
providers: Vec<MockProvider>,
max_iterations: usize,
tool_executor: Box<dyn Fn(&ToolCallFull) -> String + Send + Sync>,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: AgentLoop reimplements orchestration instead of calling production ForgeApp::chat, so these tests can pass while hooks, persistence, retries, limits, and lifecycle behavior are broken. [incomplete implementation]

Assessment: 🟠 Major · 🔁 Occurrence: Often

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/forge_api/tests/e2e_mock_provider.rs
**Line:** 180:184
**Comment:**
	*Incomplete Implementation: `AgentLoop` reimplements orchestration instead of calling production `ForgeApp::chat`, so these tests can pass while hooks, persistence, retries, limits, and lifecycle behavior are broken.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +267 to +270
if let Some(result) = stream.next().await {
match result {
Ok(msg) => return Ok(msg),
Err(e) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: call_provider reads only the first stream item, so later content or tool-call chunks are discarded and streaming aggregation is never tested. [logic error]

Assessment: 🟠 Major · 🔁 Occurrence: Often

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/forge_api/tests/e2e_mock_provider.rs
**Line:** 267:270
**Comment:**
	*Logic Error: `call_provider` reads only the first stream item, so later content or tool-call chunks are discarded and streaming aggregation is never tested.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +295 to +297
let args = call.arguments.parse().unwrap_or_default();
let cmd = args.get("command").and_then(|v| v.as_str()).unwrap_or("echo 'no command'");
format!("Mock shell output for: {cmd}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Malformed tool arguments become harmless defaults and every execution is marked successful, so invalid-argument failures and retry or interruption behavior cannot be detected. [error handling]

Assessment: 🟠 Major · 🔁 Occurrence: Often

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/forge_api/tests/e2e_mock_provider.rs
**Line:** 295:297
**Comment:**
	*Error Handling: Malformed tool arguments become harmless defaults and every execution is marked successful, so invalid-argument failures and retry or interruption behavior cannot be detected.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +488 to +490
let provider = MockProvider::new("concurrent");
for i in 0..5 {
provider.push_response(MockResponse::text(format!("Response for conversation {i}"))).await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Concurrent tasks share one response queue without request identity, so scheduling can give conversation i another conversation's response and make this test fail nondeterministically. [race condition]

Assessment: 🟠 Major · 🔁 Occurrence: Sometimes

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/forge_api/tests/e2e_mock_provider.rs
**Line:** 488:490
**Comment:**
	*Race Condition: Concurrent tasks share one response queue without request identity, so scheduling can give conversation `i` another conversation's response and make this test fail nondeterministically.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +632 to +634
let provider = MockProvider::new("usage-accum");
provider.push_response(MockResponse::text_with_usage("Turn 1", 100)).await;
provider.push_response(MockResponse::text_with_usage("Turn 2", 200)).await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The usage test queues three responses, but the first text response ends AgentLoop::run; it never verifies accumulation across multiple turns. [possible bug]

Assessment: 🟠 Major · 🔁 Occurrence: Often

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/forge_api/tests/e2e_mock_provider.rs
**Line:** 632:634
**Comment:**
	*Possible Bug: The usage test queues three responses, but the first text response ends `AgentLoop::run`; it never verifies accumulation across multiple turns.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@KooshaPari
KooshaPari merged commit d16b4b2 into main Sep 1, 2026
23 of 32 checks passed
@KooshaPari
KooshaPari deleted the fix/benchmarks-cache-v4 branch September 1, 2026 04:27
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.

2 participants