Commit abd8312
authored
Add meta-harness user-agent dimension for omnigent (#836)
## Why
[Omnigent](https://github.com/omnigent-ai/omnigent) is a meta-harness
that orchestrates AI coding agents (Claude Code, Codex, Cursor, and
others). It is not itself an agent, so it does not belong in the
existing `agent/<name>` user-agent dimension. We want telemetry that
surfaces both the meta-harness and the underlying agent at the same
time. ("meta-harness" matches omnigent's own self-description; "harness"
alone is how the field labels the underlying agents like Claude Code.)
## Changes
Before: the SDK reported only `agent/<name>` (e.g. `agent/claude-code`)
for the detected AI coding agent.
Now: the SDK also reports an independent `meta-harness/<name>`
dimension. When the `OMNIGENT` environment variable is present (omnigent
stamps `OMNIGENT=1` into every agent process, see
omnigent-ai/omnigent#656), the user agent gains a
`meta-harness/omnigent` segment. Because it is a separate dimension from
agent detection, running Claude Code under omnigent yields both
`agent/claude-code` and `meta-harness/omnigent`, and omnigent never
trips the agent "multiple" logic.
Implementation mirrors the existing agent dimension, all in
`core/UserAgent.java`:
- New `metaHarnessProvider` cache field, a `KnownMetaHarness` model +
`listKnownMetaHarnesses()` table, a presence-based
`lookupMetaHarnessProvider()`, and a cached `metaHarnessProvider()`
(double-checked locking, mirroring `agentProvider()`).
- `asString()` appends the `meta-harness/<name>` segment right after the
agent segment.
## Test plan
- [x] `mvn -pl databricks-sdk-java test -Dtest=UserAgentTest` (5 new
tests)
- [x] Detection tests: present / absent / empty-value-still-counts /
cached
- [x] Independence test: with both `OMNIGENT` and `CLAUDECODE` set, the
UA contains both `agent/claude-code` and `meta-harness/omnigent`, and
does not contain `agent/multiple`
- [x] `spotless:apply` clean (no reformatting)
---------
Signed-off-by: simon <simon.faltum@databricks.com>1 parent d5c7799 commit abd8312
3 files changed
Lines changed: 115 additions & 0 deletions
File tree
- databricks-sdk-java/src
- main/java/com/databricks/sdk/core
- test/java/com/databricks/sdk/core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
| |||
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
| 181 | + | |
| 182 | + | |
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
| |||
362 | 368 | | |
363 | 369 | | |
364 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
365 | 412 | | |
366 | 413 | | |
367 | 414 | | |
| |||
Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
617 | 619 | | |
618 | 620 | | |
619 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
620 | 686 | | |
0 commit comments