Skip to content

agent: leave out of each infer the observations the server holds - reuse-feedback-obs, SPEC 10.1 - #16

Merged
tactino merged 2 commits into
mainfrom
feat/reuse-feedback-obs
Oct 2, 2026
Merged

tactino merged 2 commits into
mainfrom
feat/reuse-feedback-obs

Conversation

@tactino

@tactino tactino commented Oct 1, 2026

Copy link
Copy Markdown
Member

The client side of plugrl-protocol#11. A feedback carries the observation the next chunk starts from, and the next infer used to send it again. When the server lists reuse-feedback-obs, the agent now leaves those rows out of the infer and marks them in reuse. Stacked on #15: merge that first. Only the last commit is new.

The decision is the agent's, so neither the rollout nor any other caller changes. A row is left out only when all of these hold:

  • the server lists the feature, and --reuse-feedback-obs is on (the default; --no-reuse-feedback-obs turns it off);
  • the env's last feedback on this connection did not end its episode, since that feedback carried the terminal observation and not the reset one;
  • the row is identical to the one that feedback carried. The agent keeps its own copy, so a caller that reuses its buffers cannot make it skip a row that changed.

A new connection holds nothing, so the record is cleared on every close and reconnect.

Checks:

  • tests/test_reuse_feedback_obs.py, 7 cases:
    • held rows are left out, including every row;
    • a row that changed is sent;
    • an env whose feedback ended its episode sends its reset, even when the reset looks the same;
    • nothing is left out when the server does not offer the feature, or when the option is off;
    • nothing is left out on a new connection;
    • nothing is left out when the observation changed in place.
  • The probe checker from plugrl-protocol#11, all three scenarios with the client running probe-v1:
    • with --features reuse-feedback-obs: no violations. 9 infers reused rows, all of them rows the server held, including after the resync.
    • without the feature: no violations, and no reuse sent.
  • Local run: 143 passed, 15 skipped. ruff 0.12.12 is clean.

plugrl-protocol is pinned to the commit of plugrl-protocol#11 that adds REUSE_FEEDBACK_OBS. It moves to main once that merges.

…nReplaced); probe-v1 env for plugrl-conformance --probe

The probe checker's resync scenario failed this client: after the agent
reconnected inside its next call, envs mid-chunk kept executing chunks from
the old connection and sent their feedback on the new one, and a failed
feedback was followed by a reconnect inside the next feedback call. SPEC 7.6
forbids both. The agent now raises ConnectionReplaced instead, feedback never
reconnects, and the rollout drops every chunk in flight and re-plans every
env; ended episodes are still reset. The reconnect-on-server-stop resend
(the SPEC 7.6 Gap) is gone with it.
…C 10.1, reuse-feedback-obs)

A feedback carries the observation the next chunk starts from, and the next
infer sent it again. When the server lists reuse-feedback-obs in its
metadata, the agent now marks in `reuse` each row the server already has
and sends only the others.

The decision is the agent's, not the rollout's, so no caller has to know the
feature exists. A row is left out only when:
- the server lists the feature and --reuse-feedback-obs is on (the default);
- the env's last feedback on this connection did not end its episode, since
  that feedback carried the terminal observation and not the reset one;
- the row is identical to the one that feedback carried. The agent keeps its
  own copy, so a caller that reuses its buffers cannot make it skip a row
  that changed.

A new connection holds nothing, so the record is cleared on every close and
reconnect. plugrl-protocol is pinned to the commit of plugrl-protocol#11 that
adds the constant; it moves to main once that merges.
@tactino
tactino merged commit ece6916 into main Oct 2, 2026
2 checks passed
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.

1 participant