Elwyn Benson (6c5a9c69) at 18 Mar 00:04
Extract action dispatch logic from NodeExecutor into an ActionExecutor interface and factory pattern, preparing for sandboxed execution in follow-up MRs.
ActionExecutor interface with execute() and dispose()
ActionExecutorFactory interface with createExecutor()
DirectActionExecutor that wraps existing handler dispatch logicDefaultActionExecutorFactory (returns DirectActionExecutor)NodeExecutor to inject ActionExecutorFactory instead of collection(WorkflowActionHandler)
DefaultActionExecutorFactory in workflowExecutorContributions
node_executor.test.ts to use mockActionExecutor / mockActionExecutorFactory
No behavior change. This is a pure refactor that introduces the seam for a follow-up MR to swap in a SandboxedActionExecutor when the DuoSandboxedExecution feature flag is enabled.
Part of https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/issues/2068
Elwyn Benson (5ee2760b) at 18 Mar 00:03
Merge branch 'kjamoralin/2068-action-executor-abstraction' into 'main'
... and 1 more commit
Hey @mcorren, @donaldcook, assuming the CI detection is working, does this implementation seem ok?
Adds a beta consent prompt to Duo CLI that requires users to accept GitLab's Testing Agreement before using the tool.
On first launch, the CLI shows the consent text and waits (y/Y to accept, n/N to reject). Once accepted, consent is persisted to storage and the prompt isn't shown again.
Handles non-interactive environments (throws with instructions to accept via storage config) and CI environments (silently skips beta consent).
I changed the implementation to show which key the user pressed, after I recorded all of these. Sorry too lazy to re-record, but it will show the y/n that was pressed
mise install && npm installnpm run clin to decline, confirm Duo CLI exitsnpm run cliy to accept, confirm the TUI loads~/.gitlab/storage.json to reset testingfeature: New feature - a user-facing change which adds functionality - included in changelogElwyn Benson (b8becfdb) at 17 Mar 23:10
feat(cli): add beta consent agreement
Nice @kjamoralin, this is a clean separation!
Extract action dispatch logic from NodeExecutor into an ActionExecutor interface and factory pattern, preparing for sandboxed execution in follow-up MRs.
ActionExecutor interface with execute() and dispose()
ActionExecutorFactory interface with createExecutor()
DirectActionExecutor that wraps existing handler dispatch logicDefaultActionExecutorFactory (returns DirectActionExecutor)NodeExecutor to inject ActionExecutorFactory instead of collection(WorkflowActionHandler)
DefaultActionExecutorFactory in workflowExecutorContributions
node_executor.test.ts to use mockActionExecutor / mockActionExecutorFactory
No behavior change. This is a pure refactor that introduces the seam for a follow-up MR to swap in a SandboxedActionExecutor when the DuoSandboxedExecution feature flag is enabled.
Part of https://gitlab.com/gitlab-org/editor-extensions/gitlab-lsp/-/issues/2068
Replaces the Anthropic backend's workflow-executor-based tools with pi-mono-derived tool implementations, and simplifies the system prompt.
New pi_tools/ module (packages/cli/src/backend/anthropic/pi_tools/):
read.ts — File reading with offset/limit and head-truncation (line + byte limits)write.ts — File writing with auto-mkdiredit.ts — Exact text replacement with fuzzy matching and diff generationbash.ts — Shell execution with timeout support and tail-truncationtruncate.ts — Shared head/tail truncation utilitiespath_utils.ts — Path resolution with macOS filename variant fallbacksedit_diff.ts — Fuzzy text matching and unified diff generationTool layer refactor (tools.ts):
WorkflowTools → PiTools with 4 built-in tools (read, write, edit, bash) + MCPWorkflowActionHandler, FileStateTracker, CredentialProvider
Logger, ParsedCliInput, McpManager
System prompt (system_prompt.ts):
TUI integration (tool_input_formatter.ts):
Generally LGTM @viktomas! I'm ok with the split, so long as we're intentional in direct no longer having parity with tui since the overhead of supporting features in both will be harder now in some cases
This isn't necessary right? The tool descriptions themselves are already provided in the context
Love it!
and images (jpg, png, gif, webp). Images are sent as attachments.
Not sure we should say this? Images are NOT sent as attachments, they are read and sent directly as text via the tool response. And while the LLM can read some image metadata, it won't actually "see" the image like other harnesses do when using the actual provider image APIs
I personally dislike the lack of read-before-edit enforcement
Not a problem if the agent is running in isolation, annoying problem if you're running an agent in the same place you're actively working!
We can at least try to make it less likely to make changes in plan mode, though I don't like that it's not enforced and I can't trust it completely!
- Do NOT produce code edits, diffs, or implementation artifacts. Your output is analysis and a plan only.
- Do NOT use 'bash' tool to modify files (e.g. with `sed`, `echo`). User MUST switch to \`build\` mode before you may run those commands.`;This break in tools also means any future custom agents or integration with agent catalog will be unsupported in duo direct
Noting difference from DAP run_command which filters certain known sensitive CI env vars
This is merged, prompt history responsibilities are extracted, helping the effort to thin-down our tui_controller
This test tidyup is merged. All tests working with AsyncIterators / AsyncGenerators (e.g. workflow streams) are updated to use a new consolidated set of test helpers instead of re-declaring helpers inline every time.