[PR #93] [MERGED] feat: patch refiner #153

Closed
opened 2026-06-06 22:09:26 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vxcontrol/pentagi/pull/93
Author: @zavgorodnii
Created: 12/17/2025
Status: Merged
Merged: 12/29/2025
Merged by: @asdek

Base: feat/graphiti-searchHead: feat/patch-refiner


📝 Commits (1)

  • da9019b feat: added patch refiner

📊 Changes

12 files changed (+1129 additions, -22 deletions)

View changed files

📝 backend/pkg/providers/openai/config.yml (+2 -2)
📝 backend/pkg/providers/performers.go (+47 -12)
📝 backend/pkg/providers/provider.go (+7 -1)
backend/pkg/providers/subtask_patch.go (+249 -0)
backend/pkg/providers/subtask_patch_test.go (+679 -0)
📝 backend/pkg/templates/prompts/refiner.tmpl (+38 -5)
📝 backend/pkg/templates/templates.go (+1 -1)
📝 backend/pkg/templates/validator/testdata.go (+1 -0)
📝 backend/pkg/tools/args.go (+26 -0)
📝 backend/pkg/tools/registry.go (+9 -0)
📝 backend/pkg/tools/tools.go (+69 -0)
📝 docker-compose.yml (+1 -1)

📄 Description

Description of the Change

Problem

The current subtask refiner regenerates the entire subtask list on each refinement cycle, which is token inefficient - Requires the LLM to output all subtasks even when only minor changes are needed.

Solution

Implement a delta-based patch system for subtask refinement that allows the refiner to submit only the changes needed rather than regenerating the complete list.

Key changes:

  • Introduced SubtaskPatch with four operation types: add, remove, modify, and reorder
  • Each operation targets specific subtasks by ID for precise modifications
  • Added applySubtaskOperations() function to apply patch operations to the existing subtask list
  • Updated refiner prompt to instruct the LLM to use delta operations
  • Created dedicated GetRefinerExecutor() with the new subtask_patch tool
  • Added comprehensive validation and error handling for patch operations
  • Increased refiner max_tokens from 8192 to 16384 for complex refinement scenarios

Additional optimizations:

  • Changed default Graphiti model from gpt-5 to gpt-5-mini

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/vxcontrol/pentagi/pull/93 **Author:** [@zavgorodnii](https://github.com/zavgorodnii) **Created:** 12/17/2025 **Status:** ✅ Merged **Merged:** 12/29/2025 **Merged by:** [@asdek](https://github.com/asdek) **Base:** `feat/graphiti-search` ← **Head:** `feat/patch-refiner` --- ### 📝 Commits (1) - [`da9019b`](https://github.com/vxcontrol/pentagi/commit/da9019bdf3c651d83b24faa49510b170d4b251d2) feat: added patch refiner ### 📊 Changes **12 files changed** (+1129 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `backend/pkg/providers/openai/config.yml` (+2 -2) 📝 `backend/pkg/providers/performers.go` (+47 -12) 📝 `backend/pkg/providers/provider.go` (+7 -1) ➕ `backend/pkg/providers/subtask_patch.go` (+249 -0) ➕ `backend/pkg/providers/subtask_patch_test.go` (+679 -0) 📝 `backend/pkg/templates/prompts/refiner.tmpl` (+38 -5) 📝 `backend/pkg/templates/templates.go` (+1 -1) 📝 `backend/pkg/templates/validator/testdata.go` (+1 -0) 📝 `backend/pkg/tools/args.go` (+26 -0) 📝 `backend/pkg/tools/registry.go` (+9 -0) 📝 `backend/pkg/tools/tools.go` (+69 -0) 📝 `docker-compose.yml` (+1 -1) </details> ### 📄 Description ### Description of the Change #### Problem The current subtask refiner regenerates the entire subtask list on each refinement cycle, which is **token inefficient** - Requires the LLM to output all subtasks even when only minor changes are needed. #### Solution Implement a **delta-based patch system** for subtask refinement that allows the refiner to submit only the changes needed rather than regenerating the complete list. **Key changes:** - Introduced `SubtaskPatch` with four operation types: `add`, `remove`, `modify`, and `reorder` - Each operation targets specific subtasks by ID for precise modifications - Added `applySubtaskOperations()` function to apply patch operations to the existing subtask list - Updated refiner prompt to instruct the LLM to use delta operations - Created dedicated `GetRefinerExecutor()` with the new `subtask_patch` tool - Added comprehensive validation and error handling for patch operations - Increased refiner max_tokens from 8192 to 16384 for complex refinement scenarios **Additional optimizations:** - Changed default Graphiti model from `gpt-5` to `gpt-5-mini` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-06 22:09:26 -04:00
yindo closed this issue 2026-06-06 22:09:26 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#153