Skip to content

Agents - bot-mode reporting includes stale controller rows from inactive runtimes #234

Description

@mlguys

Area

Agents & chat

What happened

A bot-operated Agent reported open positions, exposure, and PnL from inactive
prior bot runtimes as though they were still live.

At one checkpoint, the active-bot endpoint returned exactly one current runtime.
Its controller custom_info schema-3 ledger reported 2 active positions and
0.04115160993802155 quote PnL. Condor reported 24 running positions,
13.43899382355312 quote exposure, and 0.09556344473681769 quote PnL.

The latest controller-performance response contained nine prior runtime records
that were absent from the active-bot endpoint but still carried status=running.
Those records contributed 22 position rows and 8.694458... quote exposure to
the Agent report.

The complete sanitized observation and arithmetic are attached as
condor-agent-reporting-evidence.txt.

Expected

  • Current open positions, exposure, and unrealized PnL should include only bot
    instances confirmed by the active-bot inventory.
  • Prior-runtime running records should not become live merely because they
    remain in the latest-performance response.
  • Historical realized PnL may continue through the existing history path.
  • If a controller provides an explicit reporting ledger in custom_info, Condor
    should preserve its provenance instead of silently mixing it with incompatible
    generic metrics.

Likely source path

A narrow fix would reconcile live performance rows against active bot instance
identities before building the current open book. Suggested regression coverage
belongs in tests/test_bot_performance.py and/or
tests/test_session_pnl_attribution.py.

Steps to reproduce

  1. Use a stable bot base that has a current runtime and an older runtime.
  2. Return only the current runtime from the active-bot endpoint.
  3. Return both runtimes from latest controller performance, with both records
    still reporting status=running and carrying positions_summary rows.
  4. Fetch the bot-mode Agent performance for the stable base.
  5. Observe that positions from both current and inactive runtimes contribute to
    open count, unrealized PnL, and exposure.

Environment

Observed in a private downstream checkout; no private branch or source is
published with this report. The implicated logic was independently confirmed in
public upstream Condor commit
a3997a2b.

Logs

Attach: condor-agent-reporting-evidence.txt

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions