feat: v2 - ai assistent - debug agent#2332
Open
maxy-shpfy wants to merge 1 commit into
Open
Conversation
This was referenced May 28, 2026
🎩 PreviewA preview build has been created at: |
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced May 28, 2026
7cec3fc to
7dc9561
Compare
f151830 to
21732c0
Compare
21732c0 to
b490705
Compare
7dc9561 to
7688762
Compare
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Introduces a
debug-assistantsub-agent that diagnoses failed pipeline runs by inspecting execution details, container state, and truncated logs. The agent is read-only and cannot mutate the pipeline spec or submit runs.The dispatcher is refactored from a handoff-based architecture to an
Agent.asTool(...)architecture, where each specialist (ask_general_help,ask_pipeline_repair,ask_debug_assistant) is exposed as a tool. This allows the dispatcher's own LLM loop to chain multiple specialist calls in a single turn — for example, callingask_debug_assistantto identify a root cause and thenask_pipeline_repairto apply the fix, without requiring a separate user message.pipeline-repairgains access tosubmit_pipeline_runso it can resubmit a run after a successful fix when the user explicitly requests it. The repair prompt is updated with a directive-based entry path: when the dispatcher passes a concrete CSOM mutation directive (e.g. derived from a debug-assistant diagnosis), pipeline-repair skips the validation-driven discovery flow and applies the targeted mutation directly.The
AgentSessionnow carriesrecentRuns, a list of the five most recent pipeline runs for the open pipeline. These are appended to the debug-assistant's system prompt at agent creation time so the model can resolve "my last run" or "the latest run" without an extra tool call.New
runToolsanddebugToolsfactories exposesubmit_pipeline_run,get_run_status,debug_pipeline_run,get_execution_details,get_execution_state,get_container_state, andget_container_logas agent tools. ThetoolBridgeimplements the correspondingToolBridgeApimethods, including a compositedebugPipelineRunthat fetches the run, root execution state, and a truncated snapshot of every failed child execution in a single call. Payload truncation (log text capped at 8 KB,debug_infocapped at 20 keys) is applied both in the bridge and in thedebugToolslayer to prevent large pod logs from consuming the model's context window.The
AiChatContentcomponent fetches recent runs for the open pipeline via React Query and passes them through to the worker on eachaskcall. ThefetchContainerLoghelper is extracted intoexecutionServiceand reused by both the existing logs UI component and the new bridge methods.Observability status labels are added for the three new
ask_*tool names so the status line updates correctly while a specialist is working inside a nestedasToolrun.Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
AI Assistant - Debug agent.mov (uploaded via Graphite)
Test Instructions
Fix to apply:directive if the cause is a single concrete input value error.ask_debug_assistantfollowed byask_pipeline_repairand return a combined diagnosis + change summary.ask_general_help.Additional Comments
The
Agent.asTool(...)migration means theagent_handoffevent no longer fires from the dispatcher. TheSUB_AGENT_LABELSmap inobservability.tsis retained for any sub-agent that uses internal handoffs, but the dispatcher's specialists are now covered by theask_*entries underTOOL_STATUS_LABELS.