Skip to content

[feat] Name what evicted a warm session, and when Secrets moved - #6369

Open
mmabrouk wants to merge 3 commits into
feat/gateway-guidance-fieldfrom
feat/lifecycle-diagnostics
Open

[feat] Name what evicted a warm session, and when Secrets moved#6369
mmabrouk wants to merge 3 commits into
feat/gateway-guidance-fieldfrom
feat/lifecycle-diagnostics

Conversation

@mmabrouk

Copy link
Copy Markdown
Member

Context

Diagnosing this week's placeholder 401s (#6362) needed production access twice, for questions the runner's own logs should have answered:

  • "What evicted this warm session?" The log said mismatch (config) and nothing else. Naming the changed field took reconstructing fingerprint inputs by hand.
  • "When were the Daytona Secrets created and deleted around the failure?" The delivery layer logs nothing by design, so the timeline had to be inferred from eviction lines.

Changes

A mismatch (config) eviction now names the changed fields:

Before: mismatch (config) key=...; evict + cold

After: mismatch (config) key=... fields=[mcpServers,permissions]; evict + cold

The applied state stores per-field digests beside the whole-request fingerprint and the facet digests. One helper computes all three from one request, so the three views can never describe different configurations. The diff compares hashes, so no config value can reach a log through this path.

Secret allocation and deletion each log one line with the count, the allowed hosts, and the elapsed time: [daytona-secrets] allocated n=2 hosts=[gateway.eu.cloud.agenta.ai] ms=840. Never an id, a generated name, a placeholder, or a value. The comment documents this as a deliberate, narrow exception to the delivery layer's log-nothing rule.

Also included: scripts/probe-secret-propagation.ts, the measurement tool for the two open Daytona questions (create-to-substitution lag, and whether deleting an old same-host Secret widens the window). It uses the runner's own SDK calls and an httpbin.org header echo. It has not been run yet; docs/design/daytona-secret-propagation/README.md carries the incident facts and the run instructions.

Tests

  • Full runner suite green (156 files / 2570 tests), typecheck clean.
  • New case pins the field-name diff (names exactly the changed fields, returns empty against an unknown applied side, and every digest is a bare hash).

Stacked on #6368.

https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt

Two blind spots this week's placeholder-401 investigation had to work
around with production access, closed:

- A 'mismatch (config)' eviction now names the changed FIELDS
  (fields=[mcpServers,permissions]). The applied state stores per-field
  digests beside the whole-request fingerprint and the facet digests,
  all three computed from one request by one helper so they can never
  describe different configurations. Names only: each side of the diff
  is a hash, so no config value can reach a log through this path.
- Daytona Secret allocation and deletion log one line each with count,
  allowed hosts, and elapsed time (never ids, generated names,
  placeholders, or values) — the create/delete timeline that had to be
  reconstructed by inference from eviction lines. Documented as a
  deliberate, narrow exception to the delivery layer's log-nothing rule.

Plus the measurement tool the Daytona questions need:
scripts/probe-secret-propagation.ts measures create-to-substitution lag
(and the delete-then-create eviction ordering with --delete-old) using
the runner's own SDK calls against httpbin.org header echo. Not yet run;
docs/design/daytona-secret-propagation/README.md carries the incident
facts, the two hypotheses, and how to run it.

Claude-Session: https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview Aug 30, 2026 10:13am

Request Review

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 29, 2026
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: f1333bbe-8ae5-46da-b291-87f5568c52c0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@dosubot dosubot Bot added dev experience Improvement of the experience using the software. For instance better error messaging documentation Improvements or additions to documentation tests labels Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

📘 Docs preview

Status ✅ Ready
Preview https://pr-6369-agenta-docs-preview.mahmoud-637.workers.dev/docs
Inspect Actions run
Commit 542f0e1a612badd591ec3285c25fa692d634cd3f

This comment updates in place on every push.

Substitution is host-dependent: a heavily-used host maps a new Secret's
value in under 2s, while a never-used host got no interception at all
within 5 minutes. Measured from the production runner with the probe
this branch ships.

Claude-Session: https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt
The Fable reproduction (2026-08-30) overturned two claims. First, the
'new host never substitutes' finding was a measurement artifact: Daytona
scrubs responses (real values are rewritten back to placeholders before
they enter the sandbox), so an echo-service instrument is blind either
way; the working instrument is a provider whose error body echoes a
MASKED key (api.openai.com). Second, with that instrument the fault is
binary per sandbox: 15 of 20 fresh sandboxes substituted on their FIRST
request (+1.5-2.9s), 5 of 20 never did (raw for 90-180s from the first
request on), a twin sandbox on the same Secret worked while the stuck
one stayed raw, stop+start repaired nothing, and the delete ordering is
irrelevant. Not a lag — a per-sandbox registration failure with no
reconciliation.

The probe script now uses the masked-echo instrument and measures the
stuck rate; the README carries the corrected findings and the updated
Daytona question.

Claude-Session: https://claude.ai/code/session_014s6jqKCsVKsNMmnrJVJkZt

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

should not be part of the pr

@mmabrouk mmabrouk added the lgtm This PR has been approved by a maintainer label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev experience Improvement of the experience using the software. For instance better error messaging documentation Improvements or additions to documentation lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant