Skip to content

Conversation

aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented Oct 3, 2025

This resolves an issue where poor coordination between manager and developer agent would lead to the developer finishing all tasks in the first "phase" and then the manager re-delegating the work again in phase 2 and phase 3.

There are still failures in communication between manager and agent, but now the manager will properly note when the work is done and exit earlier.

Summary by CodeRabbit

  • New Features

    • Streamlined manager-to-developer delegation with clearer handbacks for progress and completion updates.
    • Enhanced developer guidance in prompts for more consistent task execution and reasoning.
  • Bug Fixes

    • Fixed progress log formatting when messages start with an emoji.
  • Refactor

    • Simplified and clarified manager prompt wording to better articulate objectives.
    • Standardized prompt constants for improved consistency across the app.

Copy link

coderabbitai bot commented Oct 10, 2025

📝 Walkthrough

Walkthrough

Reworked manager-to-developer handoff into a single delegation flow with a new DelegatedDeveloperTask and dual manager handbacks. Updated ManagerHandoffInput field order. Renamed prompt constants. Added INTERNAL_MONOLOGUE_GUIDANCE and updated prompt assembly. Adjusted manager run prompt phrasing. Fixed emoji parsing in update_progress_log.

Changes

Cohort / File(s) Summary
Agent delegation and handoffs
connector_builder_agents/src/agents.py
Consolidated phase handoffs into a single delegation using tool_name_override "delegate_to_developer" with input_type DelegatedDeveloperTask. Added DelegatedDeveloperTask model. Added create_on_developer_delegation callback. Updated add_handback_to_manager to register two manager report handoffs. Reordered ManagerHandoffInput fields. Imported Callable.
Guidance prompts
connector_builder_agents/src/guidance.py, connector_builder_agents/src/run.py
Replaced PROMPT_FILE_STR with ROOT_PROMPT_FILE_STR. Introduced INTERNAL_MONOLOGUE_GUIDANCE and injected into developer prompt. Tweaked manager prompt phrasing in run_manager_developer_build.
Constants rename
connector_builder_agents/src/constants.py
Renamed PROMPT_FILE_PATH → ROOT_PROMPT_FILE_PATH and PROMPT_FILE_STR → ROOT_PROMPT_FILE_STR; values unchanged.
Tools fix
connector_builder_agents/src/tools.py
Corrected tuple unpacking for emoji-leading messages in update_progress_log: now splits first character as emoji and trims remaining message.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Manager
  participant Developer
  participant ManagerCallbacks as Manager callbacks

  User->>Manager: Start session
  note over Manager: Prepare delegation input (DelegatedDeveloperTask)
  Manager->>Developer: delegate_to_developer(DelegatedDeveloperTask)
  note right of Developer: Executes task

  alt Progress update
    Developer-->>ManagerCallbacks: report_back_to_manager(ManagerHandoffInput)
  end

  alt Completion
    Developer-->>ManagerCallbacks: report_task_completion_to_manager(ManagerHandoffInput)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title references the addition of internal monologue guidance and implies decomposition of tasks, which correspond to parts of the changeset, but it does not capture the key delegation flow updates, making it only partially descriptive.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch aj/feat/internal-monologue-and-smaller-steps

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

@github-actions github-actions bot added the enhancement New feature or request label Oct 10, 2025
Copy link

github-actions bot commented Oct 10, 2025

PyTest Results (Fast)

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit cac8fa3. ± Comparison against base commit eeb3f4c.

♻️ This comment has been updated with latest results.

@aaronsteers aaronsteers marked this pull request as ready for review October 10, 2025 17:49
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
connector_builder_agents/src/agents.py (1)

95-101: Consider removing redundant api_name field.

The api_name field in DelegatedDeveloperTask appears redundant since the developer agent already receives api_name in its instructions (line 41). Including it in the delegation input creates an opportunity for inconsistency if the values differ.

Consider simplifying to:

 class DelegatedDeveloperTask(BaseModel):
     """Input data for handoff from manager to developer."""
 
-    api_name: str
     assignment_title: str
     assignment_description: str

And update the callback accordingly:

     async def on_developer_delegation(ctx, input_data: DelegatedDeveloperTask) -> None:
         update_progress_log(
-            f"🤝 Delegating task to developer agent."
-            f"\n Task Name: {input_data.assignment_title}"
+            f"🤝 Delegating task to developer agent: {input_data.assignment_title}"
             f"\n Task Description: {input_data.assignment_description}",
             session_state,
         )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eeb3f4c and c7a20ac.

📒 Files selected for processing (5)
  • connector_builder_agents/src/agents.py (4 hunks)
  • connector_builder_agents/src/constants.py (1 hunks)
  • connector_builder_agents/src/guidance.py (3 hunks)
  • connector_builder_agents/src/run.py (1 hunks)
  • connector_builder_agents/src/tools.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
connector_builder_agents/src/agents.py (1)
connector_builder_agents/src/tools.py (2)
  • SessionState (23-54)
  • update_progress_log (190-211)
🪛 GitHub Actions: Linters
connector_builder_agents/src/agents.py

[error] 1-1: ruff format check detected differences. 2 files would be reformatted by 'ruff format --diff'. Run 'uv run ruff format .' (or 'ruff format') to fix formatting.

connector_builder_agents/src/guidance.py

[error] 1-1: ruff format check detected differences. 2 files would be reformatted by 'ruff format --diff'. Run 'uv run ruff format .' (or 'ruff format') to fix formatting.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Build PokemonTGG Connector
  • GitHub Check: Build Hubspot Connector
  • GitHub Check: Test Connector Build (JSONPlaceholder)
  • GitHub Check: Build JSONPlaceholder Connector
  • GitHub Check: Test Connector Build (PokemonTGG)
  • GitHub Check: Test Connector Build (PokemonTGG)
  • GitHub Check: Test Connector Build (JSONPlaceholder)
  • GitHub Check: Pytest (Fast)
🔇 Additional comments (7)
connector_builder_agents/src/tools.py (1)

203-203: Correct fix for emoji unpacking.

The tuple assignment properly extracts the emoji character and remainder of the message, fixing the previous bug.

connector_builder_agents/src/constants.py (1)

25-26: LGTM: Clear renaming to reflect root prompt file.

The constant names now better convey their purpose as the root prompt file reference.

connector_builder_agents/src/run.py (1)

248-250: LGTM: Clearer and more concise prompt.

The updated wording directly specifies the API and uses "objectives" terminology, aligning better with the delegated developer workflow.

connector_builder_agents/src/guidance.py (2)

11-23: LGTM: Clear narration guidance for developer agent.

The INTERNAL_MONOLOGUE_GUIDANCE provides structured guidance for task narration, helping the developer agent maintain concise, observable internal monologue during execution.


1-1: Run ruff format to fix formatting issues.

The pipeline detected formatting differences in this file and agents.py.

Run the following command to fix:

uv run ruff format .
connector_builder_agents/src/agents.py (2)

4-4: LGTM: Necessary import for callback typing.

The Callable import supports the new callback factory pattern introduced in this file.


150-165: Clarify the distinction between two manager handoffs.

The developer agent now has two separate handoff tools for reporting back to the manager: report_back_to_manager and report_task_completion_to_manager. Both use the same ManagerHandoffInput type and callback, which may confuse the developer agent about when to use each.

Consider one of these approaches:

  1. Consolidate into a single handoff if there's no semantic difference in handling
  2. Use different input types to enforce different semantics (e.g., TaskCompletionInput with fewer optional fields)
  3. Add clarifying documentation in the tool descriptions explaining when to use each

Example for approach 2:

class TaskProgressInput(BaseModel):
    """Input for reporting interim progress."""
    short_status: str
    detailed_progress_update: str
    is_blocked: bool

class TaskCompletionInput(BaseModel):
    """Input for reporting task completion."""
    short_status: str
    detailed_progress_update: str
    is_full_success: bool
    is_partial_success: bool

Can you clarify the intended distinction between these two handoffs?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
connector_builder_agents/src/tools.py (1)

201-203: Syntax fix looks correct, but emoji detection range is limited.

The unpacking on line 203 is now syntactically correct. However, the Unicode range check only covers the "Emoticons" block (U+1F600–U+1F64F), missing most emoji blocks like Miscellaneous Symbols and Pictographs (U+1F300–U+1F5FF), Transport (U+1F680–U+1F6FF), Flags (U+1F1E6–U+1F1FF), and others. Multi-codepoint emojis (e.g., with skin tone modifiers or ZWJ sequences) also won't be detected.

Since there's a fallback emoji ("📍"), this won't break functionality, but consider using a library like emoji for more robust detection:

# At the top of the file
import emoji

# In the function
if message and emoji.is_emoji(message[0]):
    emoji, message = message[0], message[1:].lstrip()

Alternatively, expand the range check to cover more common blocks or document this limitation.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eeb3f4c and cac8fa3.

📒 Files selected for processing (5)
  • connector_builder_agents/src/agents.py (4 hunks)
  • connector_builder_agents/src/constants.py (1 hunks)
  • connector_builder_agents/src/guidance.py (3 hunks)
  • connector_builder_agents/src/run.py (1 hunks)
  • connector_builder_agents/src/tools.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
connector_builder_agents/src/agents.py (1)
connector_builder_agents/src/tools.py (2)
  • SessionState (23-54)
  • update_progress_log (190-211)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Test Connector Build (JSONPlaceholder)
  • GitHub Check: Test Connector Build (PokemonTGG)
🔇 Additional comments (11)
connector_builder_agents/src/agents.py (5)

4-4: LGTM!

The Callable import is correctly added and used in the create_on_developer_delegation function return type.


73-79: LGTM!

The handoff configuration correctly uses the new DelegatedDeveloperTask input type and properly binds the callback to the session state.


95-101: LGTM!

The DelegatedDeveloperTask model is well-structured with appropriate fields for delegation context.


103-111: LGTM!

The field reordering improves logical flow by grouping success indicators before the blocked flag.


144-167: LGTM!

The dual handback pattern effectively allows the developer to report progress or completion using appropriately named tools while sharing the same handler logic.

connector_builder_agents/src/constants.py (1)

25-26: LGTM!

The constant rename from PROMPT_FILE_* to ROOT_PROMPT_FILE_* improves clarity by explicitly indicating these relate to the root prompt.

connector_builder_agents/src/run.py (1)

248-249: LGTM!

The simplified prompt construction and semantic change from "phases" to "objectives" aligns well with the broader prompt updates in this PR.

connector_builder_agents/src/guidance.py (4)

8-8: LGTM!

The import correctly uses the renamed ROOT_PROMPT_FILE_STR constant.


11-23: LGTM!

The internal monologue guidance provides clear structure for agent narration and aligns with the PR objective of breaking work into smaller steps.


60-76: LGTM!

The manager prompt correctly uses ROOT_PROMPT_FILE_STR following the constant rename.


79-96: LGTM!

The developer prompt correctly incorporates INTERNAL_MONOLOGUE_GUIDANCE to enable step-by-step narration. Note that ROOT_PROMPT_FILE_STR is intentionally only included in the manager prompt, which is appropriate for the separation of concerns between orchestration and execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant