TDD: examples/test_app.py: LLM request/response logging wrapper re-wraps chat_model.ainvoke/astream on every chat_model access, duplicating LLM REQUEST/RESPONSE log lines #174
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#179 test(examples): capture duplicate LLM request/response log entries bug (#173)
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core#174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
Commit Message:
test(examples): capture duplicate LLM request/response log entries bug (#173)Branch: tdd/m1-llm-request-log-duplication
Background and context
Companion TDD issue for bug #173 (
examples/test_app.py's AOP logging wrapper re-wrapschat_model.ainvoke/astreamon every_ensure_chat_model()call, duplicating LLM REQUEST/RESPONSE log lines). Per the project's mandatory Bug Fix TDD Workflow, a failing test proving the bug exists must be written and merged to master BEFORE the fix is implemented.Current behavior
No automated test exists that proves
_setup_request_logging's chat-model wrap inexamples/test_app.pystacks a new logging layer onchat_model.ainvoke/astreamevery time_ensure_chat_model()runs, so one real LLM call ends up logged multiple times (see #173 for full root-cause analysis and captured evidence).Expected behavior
A Behave scenario demonstrates the bug: after calling the patched
_ensure_chat_model()twice on the sameLLMAgent/chat_modelinstance (using a fake/stub chat model and a canned fake response -- no real network call), invokingainvoke()once results in the request/response being logged more than once. The assertion fails while the bug is present, and the scenario is tagged@tdd_expected_failso it passes CI via inversion until the real fix (#173) lands.Acceptance criteria
@tdd_issue @tdd_issue_173 @tdd_expected_failexists infeatures/(new or extended step file).assert/raise AssertionErroronly (per project TDD rules) and asserts that exactly one request/response pair is logged per realainvokecall after_ensure_chat_model()has been invoked twice on the same instance.@tdd_expected_failinversion.nox -s unit_testsis green; coverage unaffected or improved.features/mocks/.Supporting information
Subtasks
@tdd_issue @tdd_issue_173 @tdd_expected_fail.features/mocks/if new) with a canned response, to exercise_setup_request_logging's wrap logic twice without a real network call.ainvokecall after two_ensure_chat_model()invocations.@tdd_expected_failinversion.nox -s unit_tests,nox -s lint, andnox -s typecheckon the new files, fix any errors.Definition of Done
This issue is complete when: