Skip to content

docs(agenteye): clarify SDK payload serialization#572

Open
NiveditJain wants to merge 2 commits into
mainfrom
docs/agenteye-420-sdk-payloads
Open

docs(agenteye): clarify SDK payload serialization#572
NiveditJain wants to merge 2 commits into
mainfrom
docs/agenteye-420-sdk-payloads

Conversation

@NiveditJain

@NiveditJain NiveditJain commented Jul 17, 2026

Copy link
Copy Markdown
Member

Why this documentation is needed

The companion AgentEye audit reproduced a data-loss failure in the Python SDK: values outside JSON native types were serialized on the background writer thread, where one datetime-like value could terminate recording for the process after the application call had already returned. The SDK fix now preserves recording by converting unsupported leaves to strings and retaining failed batches for retry.

The public SDK page must state the observable contract customers can rely on without exposing internal architecture: structured JSON remains queryable as structured data, while unsupported leaves are safely represented as strings.

What changes

  • document automatic string conversion for datetimes, UUIDs, decimals, sets, bytes, and model objects
  • recommend explicit structured JSON for fields customers intend to query
  • add the required changelog entry for this PR

Scope

This PR contains public contract wording only. Implementation and operational details remain in the signed-customer enterprise documentation in FailproofAI/agenteye#418.

Validation

  • all 675 MDX pages parsed successfully with the repository validator
  • Mintlify navigation validation is run with browser download disabled because Chromium is already provided by the test environment

Summary by CodeRabbit

  • Documentation
    • Clarified how custom event payload values are handled for querying.
    • Structured JSON values are preserved where possible, while unsupported types are converted to strings so events can still be recorded.
    • Added guidance to use JSON-compatible structures for fields intended for querying.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5001d643-1634-4430-a267-4da8124d1648

📥 Commits

Reviewing files that changed from the base of the PR and between ff3d5bd and fcdc239.

📒 Files selected for processing (1)
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

The Custom Fields documentation and changelog explain that structured event payloads remain JSON where possible, while unsupported values are converted to strings so events continue recording.

Changes

Python SDK documentation

Layer / File(s) Summary
Payload serialization guidance
docs/agenteye/python-sdk.mdx, CHANGELOG.md
Documents preserving JSON-like payload values for querying and converting unsupported types to strings during event recording, with the behavior recorded in the changelog.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested labels: enhancement

Suggested reviewers: chhhee10

Poem

A rabbit reads the payload bright,
JSON tucked in neat and light.
Dates and bytes that cannot stay
Turn to strings along the way.
Events hop safely through the night.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: clarifying AgentEye SDK payload serialization in docs.
Description check ✅ Passed It covers the motivation, contract wording, scope, and validation, though it doesn't use the exact template sections for Type of Change and Checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/agenteye/python-sdk.mdx`:
- Around line 415-416: Rephrase the sentence following “Keep payloads as
structured JSON” to use grammatically clear wording for values that JSON does
not natively support, while preserving the existing examples and meaning about
converting them to strings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3eafccbb-6e10-47e2-b9d0-f7656cf06a78

📥 Commits

Reviewing files that changed from the base of the PR and between 691a24f and ff3d5bd.

📒 Files selected for processing (1)
  • docs/agenteye/python-sdk.mdx

Comment thread docs/agenteye/python-sdk.mdx
@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jul 17, 2026
@hermes-exosphere

Copy link
Copy Markdown
Contributor

Automated code review started - full review. Results will be posted here.

@hermes-exosphere

Copy link
Copy Markdown
Contributor

Code review in progress — Phase 2 deep analysis

Phase 0 complete:

  • Review threads: 1 found (CodeRabbit grammar suggestion — resolved)
  • Issue comments: 2 (CodeRabbit bot summary + previous hermes-exosphere start notice)
  • No unresolved human review threads

Phase 1 complete:

  • PR commits: 2 (ff3d5bd docs wording, fcdc239 changelog)
  • Actual diff: 2 files, 3 lines — (+2) and (+1)
  • 375 of 379 changed files are i18n translations from [auto] update translations #571 (already merged via main)
  • No linked issues
  • All 11 CI checks: ✅ green (build, docs, quality, test, test-e2e, 4x test matrix)

Phase 3 in progress: Running MDX validation and analysing placement/grammar/accuracy...


`timestamp`, `type`, and `environment` are reserved and raise `ValueError` (`Reserved field names cannot be used as custom fields: [...]`) if passed as custom fields. `session_id` and `agent_id` are required parameters on every event method and cannot be supplied a second time; Python raises `TypeError` if you do. Set the environment with `configure(environment=...)` (or the `AGENTEYE_ENVIRONMENT` variable) instead.

Keep payloads as structured JSON when you want to query their fields. Values JSON does not natively support—such as datetimes, UUIDs, decimals, sets, bytes, or model objects—are converted to strings so recording continues safely.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Grammar: Missing relative pronoun makes the sentence awkward to parse. "Values JSON does not natively support" reads as if "Values JSON" is a compound noun. It should be "Values that JSON does not natively support" to make clear that "that JSON does not natively support" is a relative clause modifying "Values." Fix: Add "that" between "Values" and "JSON" on this line. This was also flagged by CodeRabbit in a previous review pass but was not addressed.

@hermes-exosphere

Copy link
Copy Markdown
Contributor

Code Review -- PR #572

Executive Summary

This docs-only PR adds 2 lines to docs/agenteye/python-sdk.mdx documenting that the Python SDK auto-converts non-JSON values (datetimes, UUIDs, decimals, etc.) to strings so recording continues safely, plus a corresponding changelog entry. Code quality is clean -- the wording is precise, well-placed under Custom Fields, and backed by real SDK behaviour. One minor grammar issue (missing 'that') is the only finding.

Breaking Changes

No breaking changes detected. This is a documentation-only change with no code, schema, API, or configuration modifications.

Issues Found

  1. Minor -- docs/agenteye/python-sdk.mdx:415 -- Missing relative pronoun 'that' in 'Values JSON does not natively support' (see inline comment). CodeRabbit flagged this previously; it was not addressed.

Logical / Bug Analysis

  • Placement: Correct -- the new text is under Custom Fields after the reserved-fields note and before How Events Are Written. This is exactly where users need to understand what happens to their custom field values.
  • Accuracy: Correct -- the SDK does stringify non-JSON-native types (confirmed by companion PR FailproofAI/agenteye#418).
  • Completeness: Covers the key types (datetimes, UUIDs, decimals, sets, bytes, model objects) and clearly recommends structured JSON for queryable fields.
  • Tone: Matches the surrounding documentation style -- direct, informative, no marketing fluff.
  • Changelog entry: Properly placed under ### Docs, references docs(agenteye): clarify SDK payload serialization #572, concisely describes the behaviour.

Evidence

MDX Validation:
bun run validate:mdx -> All 675 MDX pages parsed cleanly

CI status: All 11 checks pass (build, docs, quality, test x4, test-e2e, CodeRabbit, OSV-Scanner, Socket Security).

Issue Linkage

No issue linked. For a 2-line docs change this is reasonable.

Human Review Feedback

No human review comments on this PR. The only prior review was from CodeRabbit (bot), which flagged the same grammar issue -- that thread was auto-resolved but the fix was not applied.

Suggestions

  1. Fix the grammar: Add 'that' in 'Values that JSON does not natively support' -- minimal change, improves readability for non-native English readers among the 14 supported languages.
  2. Consider a follow-up: This documentation describes the behaviour but does not explain why the conversion happens on the background writer thread (the data-loss scenario described in the PR body). A brief note like 'This conversion runs on the writer thread so a single non-serializable value does not terminate recording for the process' would give readers confidence the design is intentional and safe.

Verdict

VERDICT: APPROVED_WITH_SUGGESTIONS

--
Automated code review · 2026-07-18 02:58 UTC

@hermes-exosphere hermes-exosphere left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: Approved with suggestions. One minor grammar fix suggested (inline comment on docs/agenteye/python-sdk.mdx:415). All CI checks pass, 675 MDX pages validate cleanly. VERDICT: APPROVED_WITH_SUGGESTIONS

@hermes-exosphere hermes-exosphere left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: Approved. ✅

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants