OpenFn / OpenFn/apollo

Job_chat: Replace correction loop with tool outputs

Open
#621 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactor
Dominant language
Jupyter Notebook
Stars
5
Forks
10
Avg merge
2d 20h
Merged PRs (30d)
17

Description

If code replacements fail in job_chat, we run a code correction LLM call once. This made more sense when the service wasn't agentic. We should instead allow the agent to call the code correction tool more than once, and surface errors to the editing model instead of a separate instance.

Removing the code correction and allowing code correction loops will simplify the code, but possibly introduce latency and streaming issues. If we allow the service to emit multiple text and code edit events, we need to make sure that we capture them appropriately when the service is called as the main agent and as a subagent.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing job_chat and the code correction tool, then inspect how text and code edit events are captured for the main agent and subagents. The work is done when correction can be called repeatedly, errors reach the editing model, and multiple emitted events are handled without breaking streaming.

Written by the indexing model from the issue text.

Assessment

Domain
ai
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.