Skip to content

feat(tracing): thread_id for tracer hooks, GoapGraph.waiting_action (#104, #105) - #106

Merged
bsbodden merged 1 commit into
mainfrom
feat/104-105-tracer-thread-id
Nov 22, 2026
Merged

bsbodden merged 1 commit into
mainfrom
feat/104-105-tracer-thread-id

Conversation

@bsbodden

Copy link
Copy Markdown
Contributor

Closes #104, closes #105.

What changed

  • thread_id for tracer hooks (Tracer hooks receive thread_id as an explicit keyword argument #104): SafeTracerProxy and MultiTracer add the run's thread_id (None outside a run) to every hook call; supported_kwargs drops it for hooks that do not declare it, so existing tracers are unaffected. Injection lives in the two dispatch points, not at the ~30 call sites in the nodes.
  • GoapGraph.waiting_action(thread_id) (GoapGraph.waiting_action(thread_id) returns the action name a thread is waiting on #105): the wait action's name, or None for a finished/unknown thread or one paused on an approval or form.
  • on_stop receiving a GoapResult is pinned by a test (it already did).
  • Lock refreshed: langgraph 1.2.22 → 1.2.24, langchain-core → 1.8.4.
  • 0.3.1 was never tagged, so these are folded into the 0.3.1 changelog entry.

Found while porting the foood demo engine: its tracer called current_thread_id() 8 times and it carried a waiting_at() shim for payload shapes.

Test plan

  • tests/test_tracer_thread_id.py (8): sync, async, replan, sensor, explicit-override, outside-a-run, old-style tracer, MultiTracer children.
  • tests/test_waiting_action.py (6), tests/test_on_stop_result.py (3).
  • make check: 2,270 passed, 1 skipped.

…104, #105)

- every tracer hook that declares a thread_id keyword receives the run's
  thread id, injected once in SafeTracerProxy and MultiTracer (#104)
- GoapGraph.waiting_action(thread_id) names the wait a thread is paused in (#105)
- on_stop is pinned to receive a GoapResult
- lock: langgraph 1.2.24, langchain-core 1.8.4
- folded into the unreleased 0.3.1 changelog entry
@github-actions github-actions Bot added the enhancement New feature or request label Nov 22, 2026
@github-actions

Copy link
Copy Markdown

✅ Code Quality Report

Metric Score Status
MFCQI Score 0.8113988555929216 ✅ Good
Test Coverage 94% ✅ Good
Security Issues 0 ✅ Clean

Quality Gates

  • MFCQI Score: ✅ Minimum 0.75 (Current: 0.8113988555929216)
  • Test Coverage: ✅ Minimum 80% (Current: 94%)
  • Security: ✅ Zero vulnerabilities (Current: 0)

🎉 All quality gates passed! This PR maintains high code quality standards.

📊 View detailed MFCQI breakdown

Run uv run python -m mfcqi analyze langgoap locally to see detailed metrics breakdown.

@bsbodden
bsbodden merged commit e75729d into main Nov 22, 2026
20 checks passed
@bsbodden
bsbodden deleted the feat/104-105-tracer-thread-id branch November 22, 2026 03:47
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.

GoapGraph.waiting_action(thread_id) returns the action name a thread is waiting on Tracer hooks receive thread_id as an explicit keyword argument

1 participant