Skip to content

implement task evaluation framework - #187

Open
Kavya Sree Kaitepalli (KavyaSree2610) wants to merge 12 commits into
mainfrom
kkaitepalli/eval-agent
Open

implement task evaluation framework#187
Kavya Sree Kaitepalli (KavyaSree2610) wants to merge 12 commits into
mainfrom
kkaitepalli/eval-agent

Conversation

@KavyaSree2610

@KavyaSree2610 Kavya Sree Kaitepalli (KavyaSree2610) commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary:

  • Introduces a new  microbots.auto_memory  module: a train ↔ eval loop for agents that learn a codebase by iteratively writing persistent "memory" notes about it, and are evaluated against real tasks to check whether that learned memory actually helps.

Each round works like this:

  1. Load the current top-level memory into a fresh per-round working copy.
  2. Run the eval task against the repo (agent gets the task prompt + its memory).
  3. Check whether the agent's output/patch actually solved the task.
  4. On failure, analyze the round's log to build concrete feedback, and retrain (a separate agent updates memory using that feedback).
  5. Persist the round's result and save the round's memory back to the shared top-level memory dir before the next round.
  6. Repeat until the task passes or  max_rounds  is exhausted.

Dependencies

  • datasets  and  swebench  are only needed to run the SWE-bench eval task, so they're declared as an optional  training  extra in  pyproject.toml  ( pip install .[training] ) rather than in the base  requirements.txt

  • Removed  datasets ' full transitive dependency closure ( dill ,  filelock ,  fsspec ,  hf-xet ,  huggingface_hub ,  multiprocess ,  numpy ,  pandas ,  pyarrow ,  xxhash ) from  requirements.txt , since  datasets  itself moved to the optional  training

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.72%. Comparing base (9f1c87b) to head (998040a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
+ Coverage   65.33%   69.72%   +4.39%     
==========================================
  Files          36       43       +7     
  Lines        2406     2755     +349     
==========================================
+ Hits         1572     1921     +349     
  Misses        834      834              
Flag Coverage Δ
ghcp 31.36% <40.40%> (+1.31%) ⬆️
integration 35.28% <40.40%> (+0.74%) ⬆️
ollama_local 32.99% <40.40%> (+1.07%) ⬆️
slow-browser 18.48% <0.00%> (-1.82%) ⬇️
slow-other 38.69% <40.40%> (-0.05%) ⬇️
unit 64.86% <100.00%> (+5.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/microbots/auto_memory/__init__.py 100.00% <100.00%> (ø)
src/microbots/auto_memory/cli.py 100.00% <100.00%> (ø)
src/microbots/auto_memory/eval/swebenchverified.py 100.00% <100.00%> (ø)
src/microbots/auto_memory/evalTask.py 100.00% <100.00%> (ø)
src/microbots/auto_memory/orchestrator.py 100.00% <100.00%> (ø)
src/microbots/auto_memory/task_registry.py 100.00% <100.00%> (ø)
src/microbots/auto_memory/workdir.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KavyaSree2610
Kavya Sree Kaitepalli (KavyaSree2610) marked this pull request as ready for review August 26, 2026 07:13
@KavyaSree2610 Kavya Sree Kaitepalli (KavyaSree2610) changed the title implement evaluation task framework implement task evaluation framework Aug 26, 2026

@0xba1a Bala (0xba1a) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will continue the review after rebasing


logger = getLogger(__name__)

SWE_BENCH_SUITE = "SWE-bench/SWE-bench_Verified"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Keep the name as "SWE_BENCH_VERIFIED". Because, there is an extended dataset called swe-bench.

If no instance with the given ``instance_id`` exists in the
dataset.
"""
rows = load_dataset(dataset_name, split="test")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This requires huggingface dataset library.

Can you please make the training part as an optional for microbots library and keep depending libraries under that?

dataset.
"""
rows = load_dataset(dataset_name, split="test")
for row in rows:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please check whether the load_dataset caches's the values. Otherwise, its better to store the (once loaded) dataset into a global variable.


Parameters
----------
repo_path : str

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need this repo_path argument for this function?

).stdout

run_id = f"microbots-{uuid.uuid4().hex[:8]}"
model_name_or_path = "microbots-eval-agent"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please move this hard-coded agent's name as a global variable

capture_output=True, text=True,
cwd=report_dir,
)
with open(log_path, "a") as f:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of getting a log file as the argument and dumping all logs into that, please create a log directory and store log in a separate file named after the instance_id.

Because a single shared log-file may become corrupted if we run eval on multiple instances in-parallel.

parser.add_argument("--memory-dir", default="./memory", help="Directory to store the memory file")
parser.add_argument("--model", required=True, help="Model identifier, e.g. azure-openai/gpt-4o")
parser.add_argument(
"--iterations",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to this let's have one-more argument that will control the max-iterations for the training-bot will have while creating memory.

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.

🟡 Changes recommended

Evaluation correctness, repository preparation, optional dependency loading, and memory snapshot handling have unresolved defects.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Introduces an extensible train/evaluate loop that builds persistent repository memory and validates it through SWE-bench tasks.

Changes:

  • Adds task orchestration, registration, workdir, and memory lifecycle APIs.
  • Implements SWE-bench Verified evaluation and feedback generation.
  • Adds optional training dependencies and comprehensive unit tests.
File summaries
File Description
src/microbots/auto_memory/__init__.py Exports public framework types.
src/microbots/auto_memory/cli.py Adds train/eval CLI.
src/microbots/auto_memory/evalTask.py Defines evaluation interfaces and results.
src/microbots/auto_memory/eval/swebenchverified.py Implements SWE-bench evaluation.
src/microbots/auto_memory/orchestrator.py Coordinates training and evaluation rounds.
src/microbots/auto_memory/task_registry.py Provides task discovery and registration.
src/microbots/auto_memory/workdir.py Manages run paths and memory snapshots.
test/auto_memory/test_cli.py Tests CLI behavior.
test/auto_memory/test_orchestrator.py Tests orchestration flows.
test/auto_memory/test_task.py Tests evaluation abstractions.
test/auto_memory/test_task_registry.py Tests task registration and discovery.
test/auto_memory/test_workdir.py Tests workdir and memory handling.
test/auto_memory/eval/test_swebenchverified.py Tests SWE-bench integration behavior.
requirements.txt Removes optional training dependencies.
pyproject.toml Adds the training extra.
.github/workflows/test.yml Installs training dependencies in CI.
Review details

Suppressed comments (1)

src/microbots/auto_memory/workdir.py:303

  • dirs_exist_ok=True only overlays files; it never removes top-level notes deleted or renamed during training. Since MemoryTool explicitly supports deleting stale notes, those deletions are lost and obsolete memory is carried into later rounds. Replace the top-level directory with the round snapshot instead of merging it.
    dst.mkdir(parents=True, exist_ok=True)
    if src.is_dir():
        shutil.copytree(src, dst, dirs_exist_ok=True)
  • Files reviewed: 15/16 changed files
  • Comments generated: 8
  • Review effort level: Balanced

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

Comment thread src/microbots/auto_memory/eval/swebenchverified.py Outdated
Comment thread src/microbots/auto_memory/eval/swebenchverified.py
Comment thread src/microbots/auto_memory/eval/swebenchverified.py Outdated
Comment thread src/microbots/auto_memory/orchestrator.py
Comment thread src/microbots/auto_memory/eval/swebenchverified.py Outdated
Comment thread src/microbots/auto_memory/orchestrator.py
Comment thread src/microbots/auto_memory/orchestrator.py
Comment thread src/microbots/auto_memory/workdir.py
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.

4 participants