Skip to content

fix(agent): resolve graph compilation and cli bugs from review#2

Open
Jaydeep869 wants to merge 1 commit intoMarc-cn:feature/langgraph-agentfrom
Jaydeep869:feature/langgraph-agent
Open

fix(agent): resolve graph compilation and cli bugs from review#2
Jaydeep869 wants to merge 1 commit intoMarc-cn:feature/langgraph-agentfrom
Jaydeep869:feature/langgraph-agent

Conversation

@Jaydeep869
Copy link
Copy Markdown

Summary

This PR addresses the remaining review feedback, bugs, and CI failures for PR kusari-oss#137 on the main repository. Merging this into your feature/langgraph-agent branch will automatically update PR kusari-oss#137 and resolve the failing checks.

Fixes included:

  • Bug 1 (cli.py): Fixed the UnboundLocalError in cmd_run() by ensuring final_state is handled and adding an early return if the agent graph layout fails.
  • Merge Artifact (cli.py): Restored the cmd_profiles function that was lost during a recent merge with main, which was causing uv run darnit --help and several tests to crash with a NameError.
  • Lazy Import (graph.py): Moved langgraph imports (StateGraph, END) entirely inside build_graph() to fix the ModuleNotFoundError during pytest collection.
  • Test Integrity: Updated the MCP server integration test to check len(tools) >= 15 to account for new commands merged from main.
  • Linting: Removed unused imports to ensure the ruff CI check passes.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

Framework Changes Checklist

If this PR modifies the darnit framework (packages/darnit/):

  • Updated framework spec (openspec/specs/framework-design/spec.md) if behavior changed
  • Ran uv run python scripts/validate_sync.py --verbose and it passes
  • Ran uv run python scripts/generate_docs.py and committed any doc changes

Control/TOML Changes Checklist

If this PR modifies controls or TOML configuration:

  • Control metadata defined in TOML (not Python code)
  • SARIF fields (description, severity, help_url) included where appropriate
  • Ran validation to confirm TOML schema compliance

Testing

  • Tests pass locally (uv run pytest tests/ -v)
  • Added tests for new functionality (if applicable)
  • Linting passes (uv run ruff check .)

Additional Notes

Tested locally and the full suite passes!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant