Skip to content

Correct shared agent-tooling contracts at the Workflows source #3060

Description

@stranske

Why

The consumer-managed paths manifest in stranske/Workflows/renovate-presets/consumer-managed-paths.json
owns tools/llm_provider.py, tools/langchain_client.py, and the relevant scripts/langchain/*
files synced into TMP. Current source still overwrites explicit tracing preference, dynamically
imports re, permits label prefix false positives, always synthesizes the progress-review payload,
and silently clamps structured-output repair attempts. scripts/ci_cosmetic_repair.py also retains
naive UTC. Fixing only TMP would be overwritten by sync.

Scope

Correct these contracts in stranske/Workflows, add source tests, and propagate them through the
normal consumer sync path.

Non-Goals

Do not patch consumer copies directly or change provider/model selection policy. Do not increase LLM
repair retries without an explicit bounded policy. Scaffold-only completion does not count: source
changes without source tests and consumer-sync evidence fail this issue.

Tasks

  • In tools/llm_provider.py, preserve an explicit LANGCHAIN_TRACING_V2 value instead of overwriting it when a LangSmith key exists; add cases to tests/tools/test_llm_provider.py.
  • Replace inline __import__("re") in tools/langchain_client.py with the normal module import and retain reasoning-model tests in tests/tools/test_langchain_client.py.
  • Replace bidirectional prefix matching in scripts/langchain/label_matcher.py with explicit token/alias rules and add doctor versus doc regression coverage.
  • Make progress_reviewer.build_review_payload unconditional or add a real optional review field, and make structured_output.max_repair_attempts honor an explicit bounded policy rather than silently clamp to one.
  • Replace naive UTC in scripts/ci_cosmetic_repair.py and add/adjust source-owned tests.
  • Run gh workflow run maint-68-sync-consumer-repos.yml --repo stranske/Workflows, then use scripts/check_consumer_sync_drift.py to verify the exact source changes reach Trend_Model_Project without consumer-local edits.

Acceptance Criteria

  • Workflows source tests for llm_provider, langchain_client, label matching, progress review, structured output, and cosmetic repair pass with named non-zero collections.
  • An explicit LANGCHAIN_TRACING_V2=false remains false, doctor does not match doc, and requested repair-attempt policy is either honored or rejected explicitly rather than silently truncated.
  • A generated consumer sync shows the relevant TMP files match Workflows source byte-for-byte.
  • Deliberate-break gate: temporarily restore unconditional assignment of LANGCHAIN_TRACING_V2=true; the named source test must fail, then revert the edit.

Implementation Notes

File this in stranske/Workflows, not Trend_Model_Project. Use the repository's source-first sync
process and its own issue-format validator immediately before filing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions