Repository navigation
fix(langchain): restore optional Protect hook on uninstrument - #393
Merged
Merged
Conversation
Retain the captured Protect class so disabling tracing restores its method without another optional dependency import. Clear the saved state before re-enabling to avoid stacked guardrail wrappers and stale provider/config exports. Add offline lifecycle contracts with real LangChain callbacks and OTLP HTTP exports across enable/disable cycles. Co-Authored-By: Claude Code <noreply@anthropic.com>
nik13
marked this pull request as ready for review
October 31, 2026 14:54
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
nik13
added a commit
that referenced
this pull request
Nov 10, 2026
… traceAI-langchain 0.2.2, Java 1.0.3 (#636) * chore(release): bump core, OpenAI, LangChain and Java patch versions Synchronize runtime versions, reactor parent references and release changelogs for #155, #348, #397, #393 and #425. Dependency floors are unchanged. Co-Authored-By: Claude Code <noreply@anthropic.com> * chore(release): list every change shipping in core 1.3.1, OpenAI 0.1.14 and Java 1.0.3 Core 1.3.1 also ships the PII-redaction scoping fixes (#195/#244) that sat under Unreleased, and the 1.3.0 heading gets its release date. OpenAI 0.1.14 also ships the Azure metadata (#154), Baseten (#541), Azure Government (#502), OpenRouter host (#547), full multi-message input (#245) and exhausted-stream changes. Java 1.0.3 also ships #543 and #605. Notes the remaining blank OTEL-env Authorization limitation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Keep and repair
traceAI-langchain; do not retire the callback integration for this lifecycle defect.LangChainInstrumentor.instrument()saves and wraps the optionalProtect.protect, but dev restores only the callback-manager constructor on disable. Guardrail exports therefore continue afteruninstrument(), and later enable cycles retain old wrappers/providers/configuration.Five runtime lines. No dependencies, package versions, CHANGELOG, public APIs or shared CI files changed. Current dev
7c719369577243ee37e4688432f460d25b6b34cdis merged cleanly; qualified/pushed head isd34e836e7a824d3dfabee673c03eb630a144900b.Current-base cloud requalification — 2026-11-09
All installs/tests ran in E2B or GitHub Actions, never on the local workstation. E2B used Python 3.12.16 and the current source core
fi-instrumentation-otel==1.3.0from the exact merged head. Both dependency environments passedpython -m pip check.langchain-core==0.2.43,langgraph==0.2.0langchain-core==1.7.6,langgraph==1.2.20,deepagents==0.7.34The original eight wire-level contracts cover exact method restoration, disabled exports, three enable/disable cycles, provider/config replacement, hidden inputs/outputs, absent or disappearing optional dependency, idempotence, unchanged application results/exceptions, and OTLP parent context/status/counts. The two additional tests pin class ownership and cleanup state.
The 14 historical floor failures remain explicitly unresolved. Their test IDs and failure messages are identical on current dev and head: six missing
langgraph.typesinterrupt/command APIs, one missinglanggraph.storeAPI, and seven historical error-output expectations (KeyError: 'output.value'). All other existing test outcomes match between dev and head at both bounds. This is not an all-green historical-floor compatibility claim. No existing assertion was weakened and no skip/xfail was added. The floor skips are absent Deep Agents plus the existing opt-in resolver test; latest skips only the resolver test.Only the evaluation service is synthetic. The LangChain callbacks, guardrail wrapper, OTLP serialization and loopback HTTP receiver are real. Test processes ran with an empty inherited environment, isolated home and an in-process loopback-only socket guard, with IPv4/IPv6/DNS denial probes. The cookbook subprocess uses the repository's synthetic model and loopback receiver; the parent-process socket guard is not claimed as OS-level confinement. No real provider credentials or model/vendor calls were used.
The successful exact-head E2B rerun is
qw-393-current-base-fix-1109: exit 0; sandbox deletion and subsequent 404 confirmed. Source-core and package files were staged from the exact merged head with a SHA-256 source manifest. JUnit XML, resolved freezes, comparison output and source receipt are retained in the fetchedresults.tgz.tgzarchive (the outer download archive containsresults.tgz).Readiness finding resolved: current base integration
The prior independent review found no implementation defect; it blocked only because four new core credential-header commits on dev were not included. Merge commit
d34e836e7a824d3dfabee673c03eb630a144900bintegrates current dev without conflicts. No additional runtime/test modifications were needed: the ten existing lifecycle contracts were rerun against the merged source core.The added readiness regression check fails on the reviewed head and passes on the merged head:
The remote head was checked immediately before the non-force push and matched the previously reviewed head. The live dev reference remained
7c719369577243ee37e4688432f460d25b6b34cdat the final readiness check.Reproduce in a disposable cloud checkout
Run each tuple in a fresh Python 3.12 environment. Keep
python/tests/harnessin the checkout because the Deep Agents cookbook test imports it.For the dev comparison, keep the final tests and replace only the changed runtime file with
git show 7c719369577243ee37e4688432f460d25b6b34cd:python/frameworks/langchain/traceai_langchain/__init__.pyin the disposable checkout; remove Python bytecode caches and run both commands again. That file is the only runtime difference. The E2B harness ran these same pytest arguments viapytest.main, added JUnit XML output, and compared every existing test outcome plus the floor failure messages. Resolved dependency freezes, XML and full logs are retained with the run receipt.GitHub verification on the qualified head
All 10 executed checks completed green (13 other jobs skipped) on
d34e836e7a824d3dfabee673c03eb630a144900b; unselected language/publication jobs are skipped, not claimed as executed.git diff --checkpassed. No applicable Ruff configuration, frontend contract change or migration is present.Review and release boundary
The prior independent review assessed the implementation against the applicable full internal coding standards at
future-agi/internal-docs@64a741425b77922873f629bdb9416205fe2f9139: minimal code, typing, failure paths, PR scope, naming, testing, comments, banned patterns and structure. No introduced correctness blocker was found; its sole readiness finding was current-base integration, resolved and requalified above. No frontend, migration, API contract, tenant isolation or OSS/EE boundary changes.E2E coverage: not applicable (no
e2e/harness); flows hit: n/a; marker: n/a; verdict: not applicable. The real callback/OTLP lifecycle tests are the relevant integration coverage.The PR is non-draft and prepared for reviewer/coordinator action, not approved or merged by this qualification. Release-please owns the eventual package version; no tag or publication was performed. Historical floor compatibility debt is not silently waived. No new ticket ID was invented for this existing PR.
Generated with Claude Code