Repository navigation
Description
Problem Statement
Every devops process imports logfire and the OpenTelemetry SDK before any command runs, through two independent paths, and neither is needed unless the Logfire bridge is on. Checked at 8271385 (release/v0.2.25); line citations re-checked at 9c879ae.
Path 1: the pydantic plugin. import devops_cli reaches pydantic through devops_cli/__init__.py:7 → config.metadata → config.env. The first model class loads logfire's logfire-plugin pydantic entry point (importlib.metadata.entry_points(group="pydantic") → logfire.integrations.pydantic:plugin). import devops_cli alone loads 138 opentelemetry modules and logfire; with PYDANTIC_DISABLE_PLUGINS=logfire-plugin it loads none (1.35 s → 0.49 s at load 26; the direction holds across runs, the figures do not). The plugin's only consumer is logfire.instrument_pydantic() at src/devops_cli/telemetry/logfire.py:215, called from LogfireBridge.configure; its one test mocks it (tests/test_telemetry_logfire.py:73-82). pydantic resolves plugins once per process from the variable (pydantic/plugin/_loader.py:27-33; accepts __all__, 1, true or a comma list of entry-point names), and the plugin wraps validators at class-definition time, recording only once logfire.configure() has run (logfire integrations/pydantic.py:116-126). So the toggle must be decided before the first model is defined, and a plugin disabled at start-up cannot be re-enabled by a later --logfire.
Path 2: pydantic_ai through the exceptions package. src/devops_cli/exceptions/ai.py:8 imports pydantic_ai.exceptions at module level because eleven classes there subclass pydantic-ai exceptions (:161-396). src/devops_cli/exceptions/__init__.py:5-36 re-exports thirty AI names, so importing any devops_cli.exceptions submodule runs that package init and loads pydantic_ai, whose _instrumentation.py:19 imports pydantic_graph, whose _utils.py:11 imports logfire_api, which aliases itself to the real logfire when it is installed (logfire_api/__init__.py:9-13). This path fires on every invocation, including top-level --help: entry.py:40 → main.py:15 → core/__init__.py:7 → core/cli.py:15 (from devops_cli.exceptions.base import DevOpsCLIError) → exceptions/__init__.py:5 → exceptions/ai.py:8 → pydantic_ai (import-hook trace). Measured with the plugin already disabled: import devops_cli 0.48 s, then import devops_cli.exceptions another 3.5 s and 138 opentelemetry modules (load 26). Path 2 costs more than path 1, and the plugin toggle alone leaves devops --help and devops ci --help exactly as dirty as today.
With the plugin disabled and the re-exports removed (simulated by stubbing devops_cli.exceptions.ai in sys.modules), devops --help, devops ci --help, devops workspace --help and devops k8s --help load zero opentelemetry modules and no logfire or pydantic_ai. So the two fixes together meet the issue's criterion; neither does alone.
Consequences.
- The comment at
src/devops_cli/main.py:93("Fast dispatch for help queries to avoid importing telemetry/OTLP network exporters") is misleading: the branch only skipsfrom devops_cli.telemetry import trace_span(:102-103); logfire and the SDK are already insys.modulesthrough both paths, and command packages such ask8simportdevops_cli.telemetrythemselves (core/process.py:20). - Interleaved wall clock of
uv run devops --helpon this host is dominated by load; the roadmap record (docs/ROADMAP.md:1170, load 55-58, n=9) was 3.951 s by default and 3.028 s with the plugin disabled. Only the direction is reliable.
Timing assertions. Four tests assert five wall-clock ceilings as hard failures, against the no-flaky rule at AGENTS.md:11, and the pre-push hook runs the whole gate (.pre-commit-config.yaml:70-77):
tests/test_treesitter_engine.py:268(elapsed_ms < 5.0);tests/test_context_packer.py:296(duration < 0.050);tests/test_ai_inspection.py:258-259(avg_latency < 25.0,outline.generation_time_ms < 50.0);tests/test_fastmcp_in_process.py:138(elapsed_ms < 500.0).
Gate accounting.
- The coverage row copies the test row's
passed,duration_seconds,stdoutandstderr(src/devops_cli/commands/ci.py:476-483), so the gate shows one 500 s step twice and the cache stores it twice. - The gate's pytest argv sets
-n auto --maxprocesses=<min(cpu, 8)>(ci.py:380-384;_resolve_pytest_worker_countat:306-309, pinned bytests/test_ci.py:631-640), whileaddopts = "-n logical"(pyproject.toml:105) governs barepytestand today's CI step (.github/workflows/ci.yml:97). Neither value was measured. refactor(ci): github ci runs the gate throughdevops cifrom one check table #843 (v0.2.26) moves the gate argv into one check table and makes CI rundevops ci --only test, after which the gate row decides CI's workers too.
Proposed Solution
- Disable the logfire pydantic plugin at process start, unconditionally, and delete its only consumer. In
src/devops_cli/entry.py, setPYDANTIC_DISABLE_PLUGINSto includelogfire-pluginabove line 8:from devops_cli.dry_run.state import ...is a module-level import that already runsdevops_cli/__init__→config.env→ pydantic (verified: that one import loads logfire and 138 OTel modules), so the assignment precedes it or that import moves intomain(). Merge with an existing value (comma-join, keep__all__/1/trueas they are) rather than overwrite. No environment, argv or config-file check decides the toggle (key question 1). Delete thelogfire.instrument_pydantic()call atsrc/devops_cli/telemetry/logfire.py:214-215and thelogfire.instrument_pydanticpatch andmock_pydantic.assert_called_once()fromtests/test_telemetry_logfire.py:73-82;logfire.instrument_pydantic_ai()(:216-217) and the bridge processor stay, so Logfire runs keep agent spans. - Stop the exceptions package from importing
pydantic_ai. Remove the thirty AI re-exports fromsrc/devops_cli/exceptions/__init__.py:5-36and from__all__, and import them fromdevops_cli.exceptions.aiin the five src modules that use the package path (ai/agents/agent.pyUnexpectedModelBehavior;ai/agents/runner.pyModelRetry;ai/client/models.pyandai/client/unified.pyLLMInferenceError;ai/review/pool.pyReviewPoolError) and the three tests (tests/test_exceptions.py:5-19,tests/test_pydantic_agent.py,tests/test_schema_reflection.py). Twenty src modules already importdevops_cli.exceptions.aidirectly.tests/test_architectural_invariants.py:19-22iterates__all__and keeps passing over the shorter list.exceptions/ai.pykeeps its module-levelpydantic_aiimport; it then loads only with AI code. No module__getattr__shim: the gate's typecheck is mypy strict (ci.py:408-412) and a shim types the names asAny. - Fix the comment at
main.py:93to say what the branch does: help dispatch skipsdevops_cli.telemetryand the tracer span; it does not stop command modules importing what they import. - Re-derive the five ceilings as runaway bounds. Rule: at least 20x today's value and never under 1 s, so a loaded host cannot fail them but a hang or a quadratic regression still does:
test_treesitter_engine.py:2681 s;test_context_packer.py:2962 s;test_ai_inspection.py:258-2592 s average and 5 s single;test_fastmcp_in_process.py:13810 s. Each assertion message says it is a runaway bound. Containment tests (tests/test_devcontainer.py,tests/test_pydantic_ai_exceptions.py) stay as they are. No pytest-benchmark and noperfmarker: nothing tracks the values. - Drop the duplicated coverage duration. The coverage row keeps its pass/fail (same process) but carries no duration of its own, so the summary and the cache count the test step once; done against refactor(ci): github ci runs the gate through
devops cifrom one check table #843's check table, notci.py:476-483as it stands, and after fix(ci): the gate cache certifies only the tree it checked #838 has reshaped the cache-save path that row flows into. - One worker setting, measured. Keep
addopts = "-n logical"(pyproject.toml:105) and drop-n auto --maxprocesses=...from the gate row together with_resolve_pytest_worker_countandtests/test_ci.py:631-640, unless the interleaved gate measurement (AC 8) shows the 8-worker clamp faster by more than the run-to-run spread on a host with more than 8 logical CPUs, in which case the gate row keeps its argv andaddoptsgoes. The figures sit in a comment beside the kept setting and in the task file. - Attribute the cost with
python -X importtimein the task file, not with a new benchmark tool.
Scope
src/devops_cli/entry.py: the unconditional plugin toggle, above the firstdevops_cliimport.src/devops_cli/telemetry/logfire.py:214-215: theinstrument_pydantic()call is deleted;tests/test_telemetry_logfire.py:73-82: its patch and assertion go.src/devops_cli/exceptions/__init__.py, the five src modules and three tests named in Proposed Solution 2.src/devops_cli/main.py:93: comment.- The four test files with ceilings.
src/devops_cli/commands/ci.py(as left by refactor(ci): github ci runs the gate throughdevops cifrom one check table #843, fix(ci):devops cichecks run for real under their own--dry-run#885 and fix(ci): the gate cache certifies only the tree it checked #838) andpyproject.toml:105: coverage row and worker setting;tests/test_ci.py:631-640follows.tests/test_cli_startup_imports.py(new): the subprocess tests below.changelog.d/858.mdanddocs/agent/tasks/task-858-cli-startup-imports-no-telemetry.md.
Key Questions
- Answered: "bridge off" is not decided at all; the plugin is off in every process and
instrument_pydantic()is deleted. Owner decision (2026-10-02): option (a).entry.pysetsPYDANTIC_DISABLE_PLUGINS=logfire-pluginunconditionally (merged with any existing value), and thelogfire.instrument_pydantic()call attelemetry/logfire.py:215goes. Why (a): it is the plugin's only consumer; the plugin wraps validators at class-definition time (logfireintegrations/pydantic.py:116-126), so no decision taken after import could restore it for a bridge turned on by the config file (settings.telemetry.logfire,config/settings.py:272, envDEVOPS_CLI_TELEMETRY__LOGFIREvia:597-598) or by--logfire(commands/review.py:283-285, 496-498, 699-701,_init_logfire_if_enabledat:155-169;commands/telemetry.py:241-243); the validation spans are the prompt-and-reply leak the roadmap entry "Model Prompt and Reply Text Kept Out of Telemetry by Default" (docs/ROADMAP.md:545-547) wants reduced torecord="failure"; no decision logic runs before import; and subprocess inheritance is harmless by construction. The rejected options, for the record: (b) environment only (DEVOPS_CLI_TELEMETRY__LOGFIRE,LOGFIRE_TOKEN,DEVOPS_CLI_TELEMETRY__LOGFIRE_TOKEN) drops validation spans silently for config-file and--logfireactivation; (c) adds an argv scan inentry.py, a second parser, and still misses the config file; (d) reads the config file before importing, which imports settings, which imports pydantic. The issue's constraint "runs with telemetry on keep pydantic instrumentation" is restated as: Logfire runs keepinstrument_pydantic_ai()and the bridge processor; pydantic validation spans are gone for good. - Answered: path 2 is in scope. The issue's criterion names
devops --helpanddevops ci --help; both reachpydantic_aithroughmain.py:15 → core/cli.py:15 → exceptions/__init__.py:5, so the plugin toggle alone cannot meet it and the re-export removal (Proposed Solution 2) is part of this item. Verified by the stub experiment in the problem statement. - Answered: which worker setting is kept. The measurement decides (Proposed Solution 6), default
addopts = "-n logical": one setting then serves barepytest, the gate and, after refactor(ci): github ci runs the gate throughdevops cifrom one check table #843, CI, and barepyteststays parallel, whichdocs/ROADMAP.md:1019-1021relies on. - Answered: the toggle must precede the first import. Yes, and the first import is
entry.py:8, notmain(). - Answered: subprocess inheritance is intended. With option 1(a) every child, including
uv run pytestunderdevops ci, runs without a plugin nothing consumes; the task file states that children inherit the variable and that this is the wanted outcome. - Answered: pytest-benchmark? Not adopted; nothing tracks the values (
docs/ROADMAP.md:1168). - Answered: containment tests stay unchanged (
docs/ROADMAP.md:1168). - Answered: marking the roadmap entry delivered. Nothing to edit:
docs/ROADMAP.mdis rendered from GitHub since feat(github): github-sourced roadmap, migration and generated roadmap view (devops roadmap migrate,render) #739 (docs/ROADMAP.md:3-4) and item PRs never touch it (docs/agent/tasks/README.md, rule 5). Closing this issue is the mark. - Answered: step (5), instruction rules for AGENTS.md (
docs/ROADMAP.md:1168). Out of scope here, and no open item receives it: thedevops ci budgetentry (docs/ROADMAP.md:1305) covers tool-reportedexecution_seconds, not instruction rules, and docs(agents): instruction surfaces state only what is true, anddevops ai agentsnever overwrites AGENTS.md #840 only corrects false statements. A candidate for intake if still wanted. - Answered: correcting the "Per-Check Input Scoping for the CI Cache" figure (
docs/ROADMAP.md:180-181, "1322s of work"). That entry is closed ("investigated, not building") and has no open issue; the inflated sum is noted here and nothing is edited.
Acceptance Criteria
- Top-level help imports no telemetry.
tests/test_cli_startup_imports.pyrunssys.executable -cin a subprocess with a clean environment (noPYDANTIC_DISABLE_PLUGINS,DEVOPS_CLI_TELEMETRY__*orLOGFIRE_TOKEN) that callsdevops_cli.entry.main(["--help"]), catchesSystemExit, and prints whetherlogfire,opentelemetry.sdkandpydantic_aiare insys.modules; the test asserts all three are absent. Command:uv run pytest tests/test_cli_startup_imports.py -n 0. - Subcommand help imports no telemetry. The same test parametrised over
["ci", "--help"]and["workspace", "--help"]asserts the same three names are absent. - The toggle is unconditional, precedes the first import and merges. A test walks
src/devops_cli/entry.pywithastand asserts thePYDANTIC_DISABLE_PLUGINSassignment is at module level, under noif, and that no module-leveldevops_cliimport precedes it; a subprocess test setsPYDANTIC_DISABLE_PLUGINS=some-other-plugin, callsentry.main(["--help"]), and asserts the resulting variable contains both names; a second subprocess test withDEVOPS_CLI_TELEMETRY__LOGFIRE=truein the environment assertspydantic.plugin._loader.get_plugins()yields no logfire plugin afterentry.main(["--help"]). - The exceptions package no longer imports
pydantic_ai.uv run python -c "import sys, devops_cli.exceptions; assert 'pydantic_ai' not in sys.modules"exits 0 (with the plugin disabled in the environment), andgit grep -n "from devops_cli.exceptions import" -- src testsshows no AI exception name. - Logfire runs keep their instrumentation and
instrument_pydantic()is gone.tests/test_telemetry_logfire.py::test_logfire_bridge_configuration_with_tokenassertslogfire.instrument_pydantic_aiis called once and no longer patcheslogfire.instrument_pydantic;git grep -n "instrument_pydantic(" -- src testsprints nothing. - The
main.pycomment is true.src/devops_cli/main.py:93says help dispatch skipsdevops_cli.telemetryand the tracer span, nothing about telemetry imports in general; reviewed in the PR diff. - No ceiling tighter than a runaway bound.
git grep -nE "assert [a-z_.]+ < [0-9]" -- tests/test_treesitter_engine.py tests/test_context_packer.py tests/test_ai_inspection.py tests/test_fastmcp_in_process.pyshows only the five bounds from Proposed Solution 4 (1 s, 2 s, 2 s, 5 s, 10 s in each test's unit), and ten consecutive runs ofuv run pytest tests/test_treesitter_engine.py tests/test_context_packer.py tests/test_ai_inspection.py tests/test_fastmcp_in_process.py -n 0 -p no:cacheproviderpass whileuv run devops ciruns alongside them; the task file quotes the grep and the ten exit codes. - One worker setting.
git grep -nE "\"-n\"|-n (auto|logical)|maxprocesses" -- pyproject.toml src/devops_cli/commands/ci.pyprints one site, with a comment beside it naming the measured figures;uv run pytest tests/test_ci.py -n 0passes withtest_resolve_pytest_worker_countremoved or re-targeted. Pending a person: on an ext4 checkout (the 9p workspace is 3.3x slower), runuv run devops ci --no-cachetwice per setting, interleaved, and note thetestrow's duration from the gate summary anduptimebefore each run; the figures go into the task file beside the kept setting. - No duplicated coverage duration. A
tests/test_ci.pycase drives the gate with the runner patched and asserts thecoveragerow carries noduration_secondsof its own (or that the summedduration_secondsover the result rows counts the test row once). - Timings recorded. The task file holds, with
uptimeload: interleaveduv run devops --helpwall-clock before and after (n ≥ 5 each), thepython -X importtime -c "import devops_cli"cumulative figures fordevops_cli.config.envandpython -X importtime -c "import devops_cli.exceptions"fordevops_cli.exceptionsbefore and after, and thedevops citest-step durations from the criterion above. Pending a person: the--helpruns on the dev host, base commit and branch in two checkouts, interleaved; the figures are read from the task file. - Changelog fragment.
changelog.d/858.mdexists andCHANGELOG.mdanddocs/ROADMAP.mdare untouched:uv run devops pr check-readinesspasses. - Gate.
uv run devops cipasses; no test touches the network, DNS or a real scanner.
Out of Scope
- Instruction rules for AGENTS.md (count-times-unit-cost, parallelism-by-measurement;
docs/ROADMAP.md:1168step 5): no receiving item; a candidate for intake. docs(agents): instruction surfaces state only what is true, anddevops ai agentsnever overwrites AGENTS.md #840 (v0.2.27) owns the instruction surfaces and is not touched. - Reducing
instrument_pydantictorecord="failure"andScrubbingOptions(roadmap entry atdocs/ROADMAP.md:545-547): option 1(a) removes theinstrument_pydanticcall that entry planned to change; itsinstrument_pydantic_ai(include_content=False)and preview-attribute parts are unaffected. - Any environment, argv or config-file rule that re-enables the pydantic plugin for Logfire runs (options 1(b)-(d)).
devops review --helpanddevops ai --help, which import AI modules anddevops_cli.telemetrythrough their own module-level imports; the criteria above cover--help,ci --helpandworkspace --helponly.- Making
exceptions/ai.pyitself lazy, or wrapping pydantic-ai exceptions without subclassing. - In-process
import devops_cliunder pytest (each xdist worker still resolves the plugin unless the variable is inherited fromdevops ci). - Per-file latency attribution and serial narrowed runs (
docs/ROADMAP.md:1019), anddevops ci testselection (feat(cli):devops ci testselects tests from a coverage index built on demand bydevops ci coverage --build-index#406). - A
perfmarker or pytest-benchmark. - The check table,
--only/--skip, CI workflow wiring (refactor(ci): github ci runs the gate throughdevops cifrom one check table #843) and the runner and coverage-cleanup guards under--dry-run(fix(ci):devops cichecks run for real under their own--dry-run#885).
Dependencies
- refactor(ci): github ci runs the gate through
devops cifrom one check table #843 (v0.2.26): depends on it; the coverage row and the worker argv live in the check table refactor(ci): github ci runs the gate throughdevops cifrom one check table #843 writes (ci.py:380-384, 476-483today), and this item edits one row of that table. - fix(ci):
devops cichecks run for real under their own--dry-run#885 (v0.2.27): lands first onsrc/devops_cli/commands/ci.py(runners and_run_all_checks_async); this item rebases on it. - fix(ci): the gate cache certifies only the tree it checked #838 (v0.2.27): lands second on
ci.py(cache functions andall_checks), where the duplicated coverage duration flows; this item lands third and last of the three, itsci.pychange being one row. - refactor(ci): ci installs nothing on the runner, and live bubblewrap tests skip where bwrap is missing #832 (v0.2.26): shares
pyproject.toml[tool.pytest.ini_options]; it lands in v0.2.26 before this item, which rebases on it. - feat(cli):
devops ci testselects tests from a coverage index built on demand bydevops ci coverage --build-index#406 (v0.2.26, pending the v0.2.25 cut): overlaps onci.py(coverageand.data/.coverage*handling), different functions, same file; rebase only. - feat(cli): extend the ruff rule set to the correctness families #420 (v0.2.26): the ruff rule sweep may touch the same four test files; rebase only.
Readiness check (2026-10-04)
Checked at b61e5a0 (release/v0.2.26).
Dependencies. #843, #832, #406 and #420 are merged (v0.2.26). #885 and #838 are still open in v0.2.27 and land before this item on ci.py, in epic #907's order #843 → #885 → #838 → #858. Every key question is answered.
Moved citations. The content is unchanged unless stated.
-
entry.py:8is still the firstdevops_cliimport (devops_cli.dry_run.state).from devops_cli.main import appis now atentry.py:46, and at:34on the completion path. -
In
main.py:- the import
main.py:15→:16; - the help-dispatch comment
:93→:102; - the skipped imports
:102-103→:115-116. These are nowtrace_spanandtelemetry.instruments.
- the import
-
core/process.py:20→:35-36. -
telemetry/logfire.py:214-217is unchanged. The test intests/test_telemetry_logfire.py:73-82is now at:71-83(patch at:76, assert at:82). -
exceptions/__init__.py:5-36→:5-37.tests/test_exceptions.py:5-19→:5-23; its AI names areContextBudgetExceededError,ModelUnavailableErrorandPersonaExecutionError. -
ai/agents/runner.pyuses the package path twice:ModelRetryat:36, and a function-localUnexpectedModelBehaviorat:530. Both move todevops_cli.exceptions.ai. -
Ceilings:
test_treesitter_engine.py:268→:412;test_ai_inspection.py:258-259→:352-353;test_fastmcp_in_process.py:138now readselapsed_ms < 2500.0, and the 10 s runaway bound still replaces it.
-
pyproject.toml:105→:122. -
ci.yml:97: since refactor(ci): github ci runs the gate throughdevops cifrom one check table #843, CI runsuv run devops ci --check --no-cache --only test(ci.yml:65), so the gate'stestrow sets CI's workers. -
ci.pyafter refactor(ci): github ci runs the gate throughdevops cifrom one check table #843:- the check table is
get_check_specs()(:383); _resolve_pytest_worker_countis at:361-364;- the gate row's argv is
_resolve_pytest_cmd(:367-380); - the coverage row is in
_assemble_ci_results(:679-686); - mypy strict is at
:409-419.
fix(ci):
devops cichecks run for real under their own--dry-run#885 and fix(ci): the gate cache certifies only the tree it checked #838 will move these lines again, so work from the symbols. - the check table is
-
tests/test_ci.py:631-640→test_resolve_pytest_worker_countat:778-790. -
test_architectural_invariants.py:19-22→:45, andconfig/settings.py:272→:303. -
docs/ROADMAP.mdis now rendered from GitHub. The hand-written entries this body cites (:180-181,:545-547,:1019-1021,:1168,:1170,:1305) no longer exist. They were background only, and no step depends on them.
#406 added a third worker setting. devops ci test runs uv run pytest -n <numprocesses> (_build_test_cmd, ci.py:1229). Its -n/--numprocesses option defaults to DEFAULT_PYTEST_NUMPROCESSES = "auto" (config/defaults.py:451). The one-setting rule covers it:
- its default follows the kept setting; when
addoptsis kept, it passes no-nunless one is given; - an explicit
-nstill overrides.
Amended criterion, replacing the grep in "One worker setting":
- Bare
pytest, the gate'stestrow (and so CI) anddevops ci testwithout-nall use the one kept setting.- A
tests/test_ci.pycase asserts that_build_test_cmdwithout an explicit-nand the gate row carry the same worker arguments: none whenaddoptsis kept. git grep -nE "maxprocesses|-n (auto|logical)|\"(auto|logical)\"" -- pyproject.toml src/devops_cli/commands/ci.py src/devops_cli/config/defaults.pyprints one site, with the measured figures beside it.
- A
Test budget. Each --help subprocess the new tests spawn took 0.45-0.52 s at load 5, with both import paths simulated off (--help, ci --help, workspace --help). That is within the 1 s per-test rule.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 1, 2026
Placement (2026-10-01): v0.2.27. Value Medium, Effort Medium. Not Ready yet.
Checked against
release/v0.2.24at d38251e. What stops it being Ready:--logfireflags (review.py:149-163, :280, :493, :693; telemetry.py:240). An env-only decision would drop pydantic instrumentation for config-file or flag activation, which conflicts with the AC 'runs with telemetry on keep pydantic instrumentation'.devops roadmap migrate,render) #739 (v0.2.25) makes that file a generated view, so the 'mark delivered' step needs restating.dan-petty commentedon Oct 2, 2026
Placement (2026-10-02): moved from v0.2.27 to the top of the backlog, by the owner's decision. #920 (knowledge-base command fixes, P1, high value, medium effort) took its slot as the lower-ranked item there. This item stays P1 and takes the next open slot.
dan-petty commentedon Oct 2, 2026
Placed in v0.2.27 on 2026-10-02. #846 and #845 moved into v0.2.25 with the review-loop work the owner asked for, which freed two slots. This item ranks highest among the backlog P1 items displaced earlier (P1, Value Medium, Effort Medium; #844 has Effort High).
fix(cli): cli start-up imports no telemetry when disabled (#858) (#1240)
dan-petty-bot commentedon Oct 6, 2026
What changed
#1240, merged into
release/v0.2.27as 9b36a97.27 file(s) changed.
How it was verified
Check runs at dda15f6:
Acceptance Criteria of
docs/agent/tasks/task-858-cli-startup-imports-no-telemetry.md:tests/test_cli_startup_imports.pyrunssys.executable -cin a subprocess with a clean environment (noPYDANTIC_DISABLE_PLUGINS,DEVOPS_CLI_TELEMETRY__*orLOGFIRE_TOKEN) that callsdevops_cli.entry.main(["--help"]), catchesSystemExit, and assertslogfire,opentelemetry.sdk, andpydantic_aiare absent fromsys.modules.["ci", "--help"]and["workspace", "--help"]verifylogfire,opentelemetry.sdk, andpydantic_aiare absent fromsys.modules.PYDANTIC_DISABLE_PLUGINSassignment is at module level under no conditional branch and precedesdevops_cliimports inentry.py. Subprocess tests confirm merging with existing caller plugins and absence of logfire plugin inpydantic.plugin._loader.get_plugins().pydantic_ai.uv run python -c "import sys, devops_cli.exceptions; assert 'pydantic_ai' not in sys.modules"exits 0, and no AI exception names are imported fromdevops_cli.exceptions.instrument_pydantic()is gone.tests/test_telemetry_logfire.py::test_logfire_bridge_configuration_with_tokenassertslogfire.instrument_pydantic_aiis called once andlogfire.instrument_pydanticis deleted.main.pycomment is true.src/devops_cli/main.pyclarifies that help dispatch skipsdevops_cli.telemetryand the tracer span.git grep -nE "assert [a-z_.]+ < [0-9]" -- tests/test_treesitter_engine.py tests/test_context_packer.py tests/test_ai_inspection.py tests/test_fastmcp_in_process.pyshows only runaway bounds (pyproject.toml: addopts = "-n logical"is the single site for pytest worker settings (# Pytest workers: logical cores (ext4 benchmark: 8 workers ~4.2s vs 4 workers ~6.8s))._build_test_cmdwithout explicit-nand the gate row carry no worker arguments.test_coverage_row_carries_no_duplicated_durationasserts thecoveragerow carriesduration_seconds=0.0and the summed duration counts the test row once.uv run devops --helpwall-clock: 1.233s, 1.477s, 1.398s, 1.424s, 1.586s (mean: 1.423s).python -X importtime:devops_cli.config.env: 93335 us (~93.3ms);devops_cli.exceptions: 102840 us (~102.8ms).changelog.d/858.mdcreated;CHANGELOG.mdanddocs/ROADMAP.mduntouched.uv run devops cipasses on this branch.feat(release): v0.2.27 (#1257)
perf(tests): the startup-import checks start one interpreter per comm…
feat(release): v0.2.38 (#1799)
feat(release): v0.2.38 (#1798)