Skip to content

ci: install QuarkAgent extras from setup.py, bump langchain to 1.x#930

Open
haeter525 wants to merge 3 commits into
ev-flow:masterfrom
haeter525:fix/pytest-quarkagent-extras
Open

ci: install QuarkAgent extras from setup.py, bump langchain to 1.x#930
haeter525 wants to merge 3 commits into
ev-flow:masterfrom
haeter525:fix/pytest-quarkagent-extras

Conversation

@haeter525

@haeter525 haeter525 commented Jun 21, 2026

Copy link
Copy Markdown
Member

Description

pytest.yml hardcoded langchain/langchain-core/langchain-openai versions in a standalone pip install step, completely independent of setup.py's quarkAgentRequirements. Any dependabot bump 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. This PR makes setup.py the single source of truth and bumps the trio to the latest mutually-compatible release.

Key Changes

  • .github/workflows/pytest.yml: drop the hardcoded pip install langchain==... langchain-core==... langchain-openai==... line; install via pip install ".[QuarkAgent]" instead, so CI installs whatever setup.py actually declares.
  • setup.py: bump quarkAgentRequirements to langchain==1.3.10, langchain-core==1.4.8, langchain-openai==1.3.2.
  • quark/agent/agentTools.py: @tool decorator import moved from langchain.agents to langchain.tools (LangChain 1.0 relocated it).
  • quark/agent/quarkAgent.py, quark/agent/quarkAgentWeb.py: migrated off the removed AgentExecutor + LCEL chain pattern to langchain.agents.create_agent. Conversation history keeps the same HumanMessage/AIMessage shape; the reply now comes from response["messages"][-1].content instead of response["output"].
  • tests/agent/test_agentTools.py: testColorizeInColor called the @tool-wrapped function directly; StructuredTool is 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, no ResolutionImpossible.
  • pytest tests/agent/ — 16/16 pass.
  • Both quarkAgent.py's real CLI entry point and quarkAgentWeb.py's exact construction code build a real create_agent graph with no network call (verified manually).
  • Not verified: the live agent loop itself (a real LLM call) — needs a real OPENAI_API_KEY, not available in this environment. Flagging as a known gap rather than claiming full verification.

Checklist

  • Follows project commit/style conventions
  • Self-reviewed (ran /code-review: black/pylint/mypy/bandit/codespell, fixed the one real regression found — a type annotation gap on conversationHistory that only mattered because the new create_agent API is strictly typed)
  • Documentation — N/A, no public quark.script API changed
  • No new warnings beyond known pre-existing ones (mypy --strict has pre-existing errors across this module unrelated to this change; not in scope)
  • Existing unit tests pass locally (tests/agent/, 16/16)
  • Live agent loop tested end-to-end with a real API key — not possible in this environment

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

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.21%. Comparing base (f90ae20) to head (26a0626).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
quark/agent/quarkAgentWeb.py 0.00% 4 Missing ⚠️
quark/agent/quarkAgent.py 80.00% 1 Missing ⚠️
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           
Flag Coverage Δ
unittests 81.21% <61.53%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@haeter525 haeter525 changed the title ci: install QuarkAgent extras from setup.py in pytest.yml ci: install QuarkAgent extras + bump langchain to 1.x Jun 21, 2026
@haeter525 haeter525 changed the title ci: install QuarkAgent extras + bump langchain to 1.x ci: install QuarkAgent extras from setup.py, bump langchain to 1.x Jun 21, 2026
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>
@haeter525 haeter525 force-pushed the fix/pytest-quarkagent-extras branch from 37efc7f to 223df03 Compare June 21, 2026 05:14
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>
@haeter525 haeter525 self-assigned this Jun 23, 2026
@haeter525 haeter525 marked this pull request as ready for review June 24, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant