ci: install QuarkAgent extras from setup.py, bump langchain to 1.x#930
Open
haeter525 wants to merge 3 commits into
Open
ci: install QuarkAgent extras from setup.py, bump langchain to 1.x#930haeter525 wants to merge 3 commits into
haeter525 wants to merge 3 commits into
Conversation
pytest.yml hardcoded langchain/langchain-core/langchain-openai versions in a standalone pip install step, independent of setup.py's quarkAgentRequirements. Dependabot bumps to those three packages in setup.py showed all-green CI while the hardcoded line silently kept testing the old versions (the bump was never installed, let alone tested). Install ".[QuarkAgent]" instead so setup.py is the single source of truth. Verified: pip install ".[QuarkAgent]" resolves to the same trio as before, tests/agent/ (16 tests) pass against it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #930 +/- ##
=======================================
Coverage 81.21% 81.21%
=======================================
Files 81 81
Lines 7122 7122
=======================================
Hits 5784 5784
Misses 1338 1338
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
LangChain 1.0 removed AgentExecutor and the LCEL prompt|llm|parser chain pattern in favor of langchain.agents.create_agent, and moved the @tool decorator from langchain.agents to langchain.tools. Bump quarkAgentRequirements to the latest mutually-compatible trio (langchain==1.3.10, langchain-core==1.4.8, langchain-openai==1.3.2) and rewrite quarkAgent.py/quarkAgentWeb.py's agent construction and invoke/response handling to match. conversationHistory keeps the same HumanMessage/AIMessage shape; only the invoke input key changes from input/chat_history to a single messages list, and the reply now comes from response["messages"][-1].content instead of response["output"]. test_agentTools.py's testColorizeInColor called the @tool-wrapped function directly; StructuredTool is no longer callable that way in 1.x, so switch to .func(...) like every other test in this file already does. Verified: pip install ".[QuarkAgent]" resolves clean, tests/agent/ (16 tests) pass, and both quarkAgent.py's CLI entry point and quarkAgentWeb.py's exact construction code build a real create_agent graph with no network call (confirmed manually; the live agent loop itself needs a real OPENAI_API_KEY, not available here). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37efc7f to
223df03
Compare
Add a test that drives an agent reply with two fenced code blocks, one valid JSON and one not. This exercises the json.loads success path and the JSONDecodeError branch in get_response, which the existing plain -reply test never reached. Co-Authored-By: Claude Opus 4.8 <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.
Description
pytest.ymlhardcodedlangchain/langchain-core/langchain-openaiversions in a standalonepip installstep, completely independent ofsetup.py'squarkAgentRequirements. Any dependabot bump to those three packages insetup.pyshowed all-green CI while the hardcoded line silently kept testing the old versions — the bump was never installed, let alone tested. This PR makessetup.pythe single source of truth and bumps the trio to the latest mutually-compatible release.Key Changes
.github/workflows/pytest.yml: drop the hardcodedpip install langchain==... langchain-core==... langchain-openai==...line; install viapip install ".[QuarkAgent]"instead, so CI installs whateversetup.pyactually declares.setup.py: bumpquarkAgentRequirementstolangchain==1.3.10,langchain-core==1.4.8,langchain-openai==1.3.2.quark/agent/agentTools.py:@tooldecorator import moved fromlangchain.agentstolangchain.tools(LangChain 1.0 relocated it).quark/agent/quarkAgent.py,quark/agent/quarkAgentWeb.py: migrated off the removedAgentExecutor+ LCEL chain pattern tolangchain.agents.create_agent. Conversation history keeps the sameHumanMessage/AIMessageshape; the reply now comes fromresponse["messages"][-1].contentinstead ofresponse["output"].tests/agent/test_agentTools.py:testColorizeInColorcalled the@tool-wrapped function directly;StructuredToolis no longer callable that way in 1.x, switched to.func(...)like every other test in the file already does.Motivation and Context
Issue 18z/QuarkHQ#3 (automating dependency-update PR review) surfaced this as a recurring false-positive: dependabot PRs bumping the langchain stack always showed green CI without the bump ever being exercised. Fixing the CI install path and doing the real version bump removes the need to treat these three packages as a special case going forward.
How Has This Been Tested?
pip install ".[QuarkAgent]"resolves cleanly to the new trio, noResolutionImpossible.pytest tests/agent/— 16/16 pass.quarkAgent.py's real CLI entry point andquarkAgentWeb.py's exact construction code build a realcreate_agentgraph with no network call (verified manually).OPENAI_API_KEY, not available in this environment. Flagging as a known gap rather than claiming full verification.Checklist
/code-review: black/pylint/mypy/bandit/codespell, fixed the one real regression found — a type annotation gap onconversationHistorythat only mattered because the newcreate_agentAPI is strictly typed)quark.scriptAPI changed--stricthas pre-existing errors across this module unrelated to this change; not in scope)tests/agent/, 16/16)