Skip to content

feat(audit): add callerName field to AuditToolCallRequest - #199

Merged
saurabhjain1592 merged 2 commits into
mainfrom
feat/2912-caller-name-audit
Jul 17, 2026
Merged

feat(audit): add callerName field to AuditToolCallRequest#199
saurabhjain1592 merged 2 commits into
mainfrom
feat/2912-caller-name-audit

Conversation

@gzak

@gzak gzak commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds AuditToolCallRequest.callerName (@JsonProperty("caller_name")) alongside the existing toolType field, per getaxonflow/axonflow-enterprise#2912 (sub-issue of epic #2905).
  • audit_tool_call's tool_type field was misleadingly named — every real caller (claude_code/codex/cursor/openclaw) used it to identify WHICH CLIENT made the call, not any property of the tool. toolType is now marked @Deprecated (getter, builder method, and the field itself) and kept as an input fallback only — it is NOT removed and NOT renamed. AxonFlow#auditToolCall/auditToolCallAsync needed no changes: they serialize the request POJO via Jackson, so the new field is forwarded automatically.
  • The platform side (getaxonflow/axonflow-enterprise#2953) adds the matching caller_name field to the server's AuditToolCallRequest and resolves caller_name if supplied → legacy tool_type if supplied → a default. #2953 has since merged to axonflow-enterprise main and shipped in v9.11.0. #2903 (change the no-input default from "claude_code" to "unknown") was folded into that same merge, so the current server default is "unknown", not "claude_code". Neither this PR's Java-side changes nor its tests assert a specific default value for the neither-supplied case, so no follow-up is needed here for that default change.

Test plan

  • AuditToolCallTest (WireMock): caller_name serializes standalone, legacy tool_type still serializes standalone, and both together (caller_name present, deprecated toolType still forwarded) — 3 new tests, all passing.
  • runtime-e2e/caller_name_audit/CallerNameAuditTest.java: real AxonFlow#auditToolCall() against a live agent + orchestrator, reading the persisted row back via GET /api/v1/audit/{id} — proves callerName alone, legacy toolType alone, and both together all resolve to the correct policy_details.caller_name, with the legacy tool_type key no longer written for new rows. RESULT: PASS (4/4). (Originally run against an unmerged axonflow-enterprise branch carrying #2953; re-verified after #2953 merged — see follow-up PR for the current confirmation run and a stale-README fix.)
  • ./mvnw verify — full suite: 1315 surefire tests + 12 failsafe tests, 0 failures, 0 errors.
  • tests/fixtures/wire-shape-baseline.json — added a per_type_drift entry for AuditToolCallRequest marking caller_name as a known sdk_only field ahead of the pinned OpenAPI spec (getaxonflow/axonflow @ f910aa3d6c...) catching up; scripts/wire_shape/validate.py itself skips locally (no AXONFLOW_OPENAPI_SPECS_DIR) and only runs in the dedicated CI job.
  • CHANGELOG.md — new Added bullet under [Unreleased], alongside the existing entries.

audit_tool_call's tool_type field was misleadingly named -- every real
caller (claude_code/codex/cursor/openclaw) used it to identify WHICH
CLIENT made the call, not any property of the tool. Add callerName
(wire: caller_name) alongside the existing toolType field, which is now
a deprecated input fallback (not removed, not renamed). The server
resolves caller_name if supplied, else the legacy tool_type, else a
default.

Adds unit coverage proving caller_name serializes standalone,
tool_type still works standalone, and both together, plus a
runtime-e2e test proving callerName reaches policy_details.caller_name
against a live agent + orchestrator.

Refs: getaxonflow/axonflow-enterprise#2912 (epic #2905)
Signed-off-by: Gregory Zak <gzak@getaxonflow.com>
@gzak
gzak force-pushed the feat/2912-caller-name-audit branch from fa31b10 to 7fb2fb5 Compare July 17, 2026 18:34
@gzak

gzak commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

R3 review: wire-shape baseline claim independently verified accurate (cloned the pinned spec SHA, confirmed caller_name genuinely absent, ran scripts/wire_shape/validate.py for real — passes). One suggested improvement applied: added a prerequisite note to runtime-e2e/caller_name_audit/README.md disclosing that this test fails against axonflow-enterprise main until #2953 merges, so a future reader doesn't debug it as a flaky test.

A pre-#2953 platform silently drops caller_name, so a caller who sets
only caller_name on an older platform gets the default with no in-IDE
attribution hint. Add the platform-floor caveat (requires v9.11.0+; set
tool_type as a fallback on older platforms) to the caller_name field doc
comment.

getaxonflow/axonflow-enterprise#2912

Signed-off-by: Saurabh Jain <saurabh.jain@getaxonflow.com>
@saurabhjain1592
saurabhjain1592 merged commit 313531d into main Jul 17, 2026
18 checks passed
@saurabhjain1592
saurabhjain1592 deleted the feat/2912-caller-name-audit branch July 17, 2026 20:43
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.

2 participants