Fixing the repeated step id bug#1032
Conversation
WalkthroughModified Changes
Sequence Diagram(s)sequenceDiagram
participant Code as Application Code
participant Ctx as Context Instance
participant Mgr as Intermediate Step Manager
participant Events as Event Handler
rect rgb(220, 240, 220)
Note over Code,Mgr: Before: Manager recreated each access
Code->>Ctx: .intermediate_step_manager (access 1)
Ctx->>Mgr: create new Manager A
Mgr-->>Code: Manager A
Code->>Mgr: push_intermediate_step(START)
activate Mgr
Mgr->>Mgr: record in _outstanding_start_steps
deactivate Mgr
end
rect rgb(240, 220, 220)
Code->>Ctx: .intermediate_step_manager (access 2)
Ctx->>Mgr: create new Manager B
Mgr-->>Code: Manager B
Code->>Mgr: push_intermediate_step(END)
activate Mgr
Mgr->>Mgr: search _outstanding_start_steps (EMPTY!)
Mgr-->>Events: WARNING: step not found
deactivate Mgr
end
rect rgb(220, 240, 220)
Note over Code,Mgr: After: Manager instance reused
Code->>Ctx: .intermediate_step_manager (access 1)
Ctx->>Mgr: return cached Manager
Mgr-->>Code: same Manager instance
Code->>Mgr: push_intermediate_step(START)
activate Mgr
Mgr->>Mgr: record in _outstanding_start_steps
deactivate Mgr
end
rect rgb(200, 230, 255)
Code->>Ctx: .intermediate_step_manager (access 2)
Ctx->>Mgr: return cached Manager
Mgr-->>Code: same Manager instance
Code->>Mgr: push_intermediate_step(END)
activate Mgr
Mgr->>Mgr: search _outstanding_start_steps (FOUND!)
Mgr->>Mgr: clear entry
deactivate Mgr
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (3)**/*⚙️ CodeRabbit configuration file
Files:
tests/**/*.py⚙️ CodeRabbit configuration file
Files:
src/nat/**/*⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
## Description <!-- Note: The pull request title will be included in the CHANGELOG. --> <!-- Provide a standalone description of changes in this PR. --> <!-- Reference any issues closed by this PR with "closes NVIDIA#1234". All PRs should have an issue they close--> Closes NVIDIA#1030 , AIQ-2117 Thanks a lot @willkill07 for proposing the `@cached_property`!! ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/NVIDIA/NeMo-Agent-Toolkit/blob/develop/docs/source/resources/contributing.md). - We require that all contributors "sign-off" on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. - Any contribution which contains commits that are not Signed-Off will not be accepted. - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Optimized internal caching mechanism for improved performance * Enhanced diagnostic warning messages with additional context for better troubleshooting * **Tests** * Added verification test for manager instance consistency and state tracking accuracy <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Daniel Wang <daniewang@nvidia.com>
Description
Closes #1030 , AIQ-2117
Thanks a lot @willkill07 for proposing the
@cached_property!!By Submitting this PR I confirm:
Summary by CodeRabbit
Chores
Tests