feat(client): add caller_name to audit_tool_call (#2912)#218
Merged
Conversation
gzak
force-pushed
the
feat/2912-caller-name-audit
branch
from
July 17, 2026 18:38
044b460 to
628f22e
Compare
tool_type on AuditToolCallRequest 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 caller_name as the correctly-named field; tool_type stays as a deprecated input fallback (not removed) during the deprecation window, mirroring the platform-side resolution added in getaxonflow/axonflow-enterprise#2953 (caller_name if supplied -> legacy tool_type if supplied -> default). Implements getaxonflow/axonflow-enterprise#2912, sub-issue of epic #2905. Signed-off-by: Gregory Zak <gzak@getaxonflow.com>
gzak
force-pushed
the
feat/2912-caller-name-audit
branch
from
July 17, 2026 18:45
628f22e to
b15924e
Compare
Contributor
Author
|
R3 review passed cleanly, but the final CI run on the pushed commit surfaced 3 real, fixable failures (final sweep before considering this done):
Full suite now green: 1051 passed, 29 skipped, 82.29% coverage. |
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. Also add the "platform support not yet on main" prerequisite section to the runtime-e2e README, matching the TS/Java SDKs. getaxonflow/axonflow-enterprise#2912 Signed-off-by: Saurabh Jain <saurabh.jain@getaxonflow.com>
5 tasks
gzak
added a commit
that referenced
this pull request
Jul 20, 2026
…te (#2912) (#219) axonflow-enterprise#2953 (caller_name) has merged and shipped in platform v9.11.0; it folded in #2903, which changed the fallback default written to policy_details.caller_name when neither caller_name nor tool_type is supplied from "claude_code" to "unknown" (an unidentified caller must not be silently attributed to a specific client). - runtime-e2e/caller_name_audit/test.py: add a third real-stack scenario asserting the neither-supplied case resolves to "unknown", not "claude_code". Verified against a freshly built axonflow-enterprise main (commit 7a5984ec7+, platform v9.11.0) — confirmed via direct platform inspection (audit_logs.policy_details) and through this SDK's own audit_tool_call before landing the assertion. - runtime-e2e/caller_name_audit/README.md: replace the stale "#2953 is an open PR, not yet merged" prerequisite note (accurate when PR #218 merged, no longer true) with the current v9.11.0 platform requirement; document the third scenario. No axonflow SDK code changes -- caller_name/tool_type were already both independently settable, so the SDK needed no "dual-send" cutover. Signed-off-by: Gregory Zak <gzak@getaxonflow.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
caller_nametoAuditToolCallRequest(axonflow/types.py) — the correctly-named replacement fortool_type, which every real caller (claude_code/codex/cursor/openclaw) actually used to identify which client made the call, not any property of the tool.tool_typeis kept as a deprecated input fallback, not removed — backward compatible for existing callers during the deprecation window.client.audit_tool_call(axonflow/client.py) forwardscaller_namethe same waytool_typeis forwarded today; docstring example and debug logging updated accordingly.caller_nameif supplied -> legacytool_typeif supplied -> a default.Implements getaxonflow/axonflow-enterprise#2912, sub-issue of epic #2905.
Post-merge update (see #219): axonflow-enterprise#2953 has since merged to
axonflow-enterprisemain and shipped in platform v9.11.0. That merge folded in #2903, which changed the neither-supplied default from"claude_code"to"unknown". #219 adds real-stack coverage for that scenario and corrects this PR's now-stale "#2953 open, not yet merged" note.Test plan
tests/test_audit_tool_call.py— new unit tests:caller_namesent alone,tool_typealone (backward compat), both supplied together, plus a type-levelmodel_validatetest withcaller_name.runtime-e2e/caller_name_audit/test.py— real-stack proof (no mocks) driving the actual SDK'saudit_tool_callagainst a live agent+orchestrator, pollingGET /api/v1/audit/tenant/{tenant_id}and assertingcaller_name(and the legacytool_typefallback) reachpolicy_details.caller_nameon the persisted audit row.1051 passed, 29 skipped(coverage 82.29%, threshold 75%).scripts/lint-no-mocks-in-runtime-e2e.sh— clean.ruff check— clean on all touched files.CHANGELOG.md[Unreleased]updated.