Decouple pipeline-editing surface into core pipeline_editor mode#2426
Merged
Conversation
… mode Generic `chat` mode carried the entire DM admin pipeline-editor surface — a hardcoded "you are in the Data Machine admin UI" prompt, the pipelines inventory, and ~25 pipeline-editing tools — so any portable chat surface (frontend widget, bridge) inherited the wrong location claim and admin tools. Decouple the surface into a new core `pipeline_editor` mode via additive mode composition: - Slim CHAT_MODE to a location-agnostic generic chat default. - Add PIPELINE_EDITOR_MODE (the moved pipeline/handler/flow guidance) and wire it into get_default_for_mode(). - Register `pipeline_editor` in core at priority 25. - Re-gate the pipelines inventory directive and the 25 pipeline-editing tools from `chat` to `pipeline_editor`. - The admin pipeline chat (requests carrying selected_pipeline_id) opts into [chat, pipeline_editor] server-side; portable surfaces stay on chat. AgentsChatHandler::resolveModes() still defaults to [chat] for callers that send nothing, keeping portable surfaces clean. Closes #2425
Contributor
Homeboy Results —
|
The PR moved the pipeline-editing tools (update_flow and ~24 others) from generic chat mode to the new pipeline_editor mode. These tests still encoded the pre-decouple coupling (asserting update_flow resolves under chat). - ChatToolsAvailabilityTest: assert chat EXCLUDES pipeline-editing tools and add a pipeline_editor test that asserts update_flow resolves there. - ToolPolicyResolverTest: replace the chat-includes-update_flow assertion with a chat-excludes-pipeline-tools assertion; add pipeline_editor-mode and composed [chat, pipeline_editor] union coverage; re-point the agent deny-policy chat test at send_ping (a real chat tool) since update_flow no longer resolves under chat. Full suite: 1308 passed, 3 skipped, 0 failed.
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.
Summary
Closes #2425.
Generic core mode
chatcarried the entire DM admin pipeline-editor surface — a hardcoded "you are in the Data Machine admin UI" prompt, the pipelines inventory, and ~25 pipeline-editing tools. Any portable chat surface (thefrontend-agent-chatwidget,data-machine-chat-bridge) that sends no mode defaults tochatand therefore inherited the false location claim and the admin tool surface (proven live on the extrachill.com homepage).This PR decouples the pipeline-editing surface from generic chat into a new core mode
pipeline_editor, using the existing additive mode composition (guidance concatenates, tools union).chatbecomes truly portable; the admin/pipeline context only appears when a surface that actually is the admin editor asks for it.New
pipeline_editormodeinc/bootstrap.php) at priority 25 (betweenpipeline=20 andsystem=30;editor=40 unchanged), mirroring howdata-machine-editorregisterseditor.CHAT_MODEinto a newPIPELINE_EDITOR_MODEconstant), the pipelines inventory directive, and the 25 pipeline-editing tools.[chat, pipeline_editor]server-side: inChat::handle_chat, a request carryingselected_pipeline_id(the admin pipeline editor surface) sendsmodes => ['chat','pipeline_editor']. Any explicitly-requested mode is preserved/appended. No JS rebuild required.AgentsChatHandler::resolveModes()is unchanged — still defaults to['chat']for callers that send nothing, which is correct for portable surfaces.Files changed
Core mode / directive plumbing
inc/Engine/AI/Directives/AgentModeDirective.php— slimmedCHAT_MODEto a location-agnostic generic chat default; addedPIPELINE_EDITOR_MODEwith the moved pipeline/handler/flow/scheduling/execution guidance; addedpipeline_editorcase toget_default_for_mode().inc/bootstrap.php— registered thepipeline_editormode (priority 25).inc/Api/Chat/ChatPipelinesDirective.php— re-gated the pipelines inventory directivemodesfrom['chat']to['pipeline_editor'].inc/Api/Chat/Chat.php— admin pipeline chat (selected_pipeline_idpresent) now sendsmodes => ['chat','pipeline_editor'].Tools re-gated
chat→pipeline_editor(25)create_pipeline,delete_pipeline,add_pipeline_step,configure_pipeline_step,delete_pipeline_step,reorder_pipeline_steps,create_flow,copy_flow,delete_flow,update_flow,configure_flow_steps,list_flows,get_problem_flows,run_flow,execute_workflow,api_query,authenticate_handler,get_handler_defaults,set_handler_defaults,manage_jobs,manage_queue,manage_logs,read_logs,system_health_check,delete_file.Kept on generic
chat(portable, unchanged)consult_agent,send_ping, and the taxonomy toolsassign_taxonomy_term/create_taxonomy_term/merge_taxonomy_terms/search_taxonomy_terms/update_taxonomy_term.insert_contentwas left untouched (it is multi-mode['chat','pipeline','system','editor'], not a pipeline-admin tool).Verification
php -lclean on all 29 changed files.phpcs(repo lint) clean — exit 0 on all changed files.agents-chat-handler-smoke(13),directive-policy-resolver-smoke(10),ai-step-agent-mode-plumbing-smoke(6),global-tool-pipeline-modes-smoke(16),pipeline-tool-policy-surfaces-smoke(10),mode-model-resolution-smoke(8).chat;CHAT_MODEno longer contains the admin-UI location claim or pipeline manual.mode = "chat,pipeline_editor"(exactly 20 chars, fits themode VARCHAR(20)column;processContinuealready parses comma-joined modes back into an array). The session-list endpoint applies no mode filter in practice (the JS client sendscontext, which the route argmodedoes not bind), so admin sessions still list correctly.Could not verify
Out of scope (separate follow-up)
roadiemode for the EC frontend widget (making the widget request[chat, roadie]+ populate pageclient_context) lives in extrachill-roadie / frontend-agent-chat, not this PR. This core PR only removes the wrong location from generic chat and decouples the surface.