Skip to content

ci: PR-A: flare-workflow cwd plumbing — compile_workflow_in, CommandExecutor cwd, agent_send_hook honors StepInvocation.cwd (#366 Phase 1, PR 1 of 3) - #912

Merged
getappz merged 1 commit into
masterfrom
task/368-pr-a-flare-workflow-cwd-plumbing-compile
Oct 16, 2026
Merged

getappz merged 1 commit into
masterfrom
task/368-pr-a-flare-workflow-cwd-plumbing-compile

Conversation

@getappz

@getappz getappz commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Task 0 (item #366 PR-A cwd plumbing): done at commit 1222351 — compile_workflow_in + CommandExecutor/PromptExecutor cwd, agent_send_hook cwd-aware; T33–T35 green; fmt/clippy(CI flags)/loc-gate clean. Note for PR-B/C: spec's clippy line needs -A clippy::pedantic to match CI.


Opened by claude-code on i-flare-51bb8de6c33b (flared:51bb8de6c33b) for item #368 via agentflare.

Summary by CodeRabbit

  • New Features
    • Workflows can now run commands and agents from a configured working directory without changing the app’s process-wide directory.
    • Agent persona files are resolved from the configured directory when one is provided; workflows without one retain their existing behavior.

…366 PR-A)

Add `compile_workflow_in(json, send, cwd)`; `compile_workflow` delegates
with `None`. A compiled cwd is stored on both executors: `CommandExecutor`
sets `current_dir` on the child, and `PromptExecutor` carries it as
`StepInvocation::cwd`. `agent_send_hook` now honors that cwd, resolving
personas from `<cwd>/.claude/agents` and launching via `run_headless_in`;
`None` keeps the ambient-cwd behavior, and `app_send_hook` is unchanged.
No process-wide chdir anywhere.

Tests T33–T35 from the workflow-schedules spec (rev 4 §8, §12 PR-A).
No scheduler code in this change.

Agentflare-Agent: claude-code
Agentflare-Branch: task/368-pr-a-flare-workflow-cwd-plumbing-compile
Agentflare-Item: 368
Agentflare-Session: 24cb6990-ba3e-4e85-86e1-5488b3f19121
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: getappz/agentflare/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: c18b44ef-caa7-4ded-b045-614a5ec6cf73
📥 Commits

Reviewing files that changed from the base of the PR and between f79fe5b and f65ef80.

📒 Files selected for processing: 3
  • crates/flare-workflow/src/json.rs
  • crates/flare-workflow/src/lib.rs
  • src/workflow.rs

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

Workflow compilation now accepts an optional working directory. Command steps run child processes there, and agent steps pass it through for persona lookup and launch. The existing compile entry point retains ambient-directory behavior.

Changes: Workflow working-directory support

Layer / File(s) Summary
Compile workflows with a working directory
crates/flare-workflow/src/json.rs, crates/flare-workflow/src/lib.rs
compile_workflow_in accepts an optional working directory and is re-exported from the crate root. Command and prompt executors receive the configured value. Command steps set the child process directory when it is present. Tests cover command execution, agent invocation propagation, and the legacy entry point’s None behavior.
Use the working directory for agent execution
src/workflow.rs
agent_send_hook uses the invocation directory for persona lookup and launches agents with run_headless_in when a directory is present. Without one, it retains ambient-directory lookup and launch behavior. A test covers persona resolution and prompt folding.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant compile_workflow_in
  participant CommandExecutor
  participant ChildProcess
  Caller->>compile_workflow_in: Compile workflow with optional cwd
  compile_workflow_in->>CommandExecutor: Configure child-process cwd
  CommandExecutor->>ChildProcess: Run command in configured cwd
Loading
sequenceDiagram
  participant Caller
  participant compile_workflow_in
  participant PromptExecutor
  participant agent_send_hook
  participant PersonaFiles
  participant run_headless_in
  Caller->>compile_workflow_in: Compile workflow with optional cwd
  compile_workflow_in->>PromptExecutor: Configure invocation cwd
  PromptExecutor->>agent_send_hook: Pass invocation cwd
  agent_send_hook->>PersonaFiles: Resolve persona under cwd
  agent_send_hook->>run_headless_in: Launch agent in cwd
Loading
Merge Risk: ⚪ Minimal · up to f65ef

No actionable issue is established for this phase of working-directory support. The production entry point remains scheduled for a later phase.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 3 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the main change: cwd plumbing for workflow compilation, command execution, and agent invocation. It is overly long and includes phase and issue metadata, but it remains sp…
Description check Passed The description summarizes the implementation and reports test, formatting, lint, and location-gate results. It does not use the required section headings and does not explicitly document risk areas o…
Full details: Title check

Explanation

The title clearly identifies the main change: cwd plumbing for workflow compilation, command execution, and agent invocation. It is overly long and includes phase and issue metadata, but it remains specific and related to the changes.

Full details: Description check

Explanation

The description summarizes the implementation and reports test, formatting, lint, and location-gate results. It does not use the required section headings and does not explicitly document risk areas or backwards compatibility.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit 358dfc3 into master Oct 16, 2026
19 checks passed
@getappz
getappz deleted the task/368-pr-a-flare-workflow-cwd-plumbing-compile branch October 16, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant