Skip to content

696 unified session#697

Merged
alexanderkirtzel merged 6 commits into
mainfrom
696-unified-session
Jul 20, 2026
Merged

696 unified session#697
alexanderkirtzel merged 6 commits into
mainfrom
696-unified-session

Conversation

@alexanderkirtzel

@alexanderkirtzel alexanderkirtzel commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added walkeros observe start for live observation sessions (web/server connect, polling/settle control, JSON output).
    • Observation wiring now uses a public connect pair with per-session credentials provided at runtime.
    • Added cookie domain support for shared session/device IDs in browser sessions.
  • Bug Fixes
    • Contract validation now rejects flat/non-canonical shapes, enforces tagging/schema types, and warns on unknown keys.
    • Push/observe ingest now uses versioned ingest envelopes and surfaces transformer-dropped events.
  • Documentation
    • Updated CLI and mode guides for observation setup/credentials and revised contract validation behavior.
  • Chores
    • Updated CI workflow action versions.

@alexanderkirtzel alexanderkirtzel linked an issue Jul 18, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Too many files!

This PR contains 172 files, which is 72 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: febd723c-e9b4-45ef-802d-361b225b4820

📥 Commits

Reviewing files that changed from the base of the PR and between 74eacdd and c0e0432.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (172)
  • apps/cli/CHANGELOG.md
  • apps/cli/package.json
  • apps/demos/react/CHANGELOG.md
  • apps/demos/react/package.json
  • apps/demos/storybook/CHANGELOG.md
  • apps/demos/storybook/package.json
  • apps/explorer/CHANGELOG.md
  • apps/explorer/package.json
  • apps/quickstart/CHANGELOG.md
  • apps/quickstart/package.json
  • apps/storybook-addon/CHANGELOG.md
  • apps/storybook-addon/package.json
  • apps/walkerjs/CHANGELOG.md
  • apps/walkerjs/package.json
  • packages/cli/CHANGELOG.md
  • packages/cli/package.json
  • packages/collector/CHANGELOG.md
  • packages/collector/package.json
  • packages/config/CHANGELOG.md
  • packages/config/package.json
  • packages/core/CHANGELOG.md
  • packages/core/package.json
  • packages/destinations/demo/CHANGELOG.md
  • packages/destinations/demo/package.json
  • packages/mcps/mcp/CHANGELOG.md
  • packages/mcps/mcp/package.json
  • packages/mcps/source-browser/CHANGELOG.md
  • packages/mcps/source-browser/package.json
  • packages/server/core/CHANGELOG.md
  • packages/server/core/package.json
  • packages/server/destinations/amplitude/CHANGELOG.md
  • packages/server/destinations/amplitude/package.json
  • packages/server/destinations/api/CHANGELOG.md
  • packages/server/destinations/api/package.json
  • packages/server/destinations/aws/CHANGELOG.md
  • packages/server/destinations/aws/package.json
  • packages/server/destinations/bing/CHANGELOG.md
  • packages/server/destinations/bing/package.json
  • packages/server/destinations/criteo/CHANGELOG.md
  • packages/server/destinations/criteo/package.json
  • packages/server/destinations/customerio/CHANGELOG.md
  • packages/server/destinations/customerio/package.json
  • packages/server/destinations/datamanager/CHANGELOG.md
  • packages/server/destinations/datamanager/package.json
  • packages/server/destinations/file/CHANGELOG.md
  • packages/server/destinations/file/package.json
  • packages/server/destinations/gcp/CHANGELOG.md
  • packages/server/destinations/gcp/package.json
  • packages/server/destinations/hubspot/CHANGELOG.md
  • packages/server/destinations/hubspot/package.json
  • packages/server/destinations/kafka/CHANGELOG.md
  • packages/server/destinations/kafka/package.json
  • packages/server/destinations/klaviyo/CHANGELOG.md
  • packages/server/destinations/klaviyo/package.json
  • packages/server/destinations/linkedin/CHANGELOG.md
  • packages/server/destinations/linkedin/package.json
  • packages/server/destinations/meta/CHANGELOG.md
  • packages/server/destinations/meta/package.json
  • packages/server/destinations/mixpanel/CHANGELOG.md
  • packages/server/destinations/mixpanel/package.json
  • packages/server/destinations/mparticle/CHANGELOG.md
  • packages/server/destinations/mparticle/package.json
  • packages/server/destinations/pinterest/CHANGELOG.md
  • packages/server/destinations/pinterest/package.json
  • packages/server/destinations/posthog/CHANGELOG.md
  • packages/server/destinations/posthog/package.json
  • packages/server/destinations/reddit/CHANGELOG.md
  • packages/server/destinations/reddit/package.json
  • packages/server/destinations/redis/CHANGELOG.md
  • packages/server/destinations/redis/package.json
  • packages/server/destinations/rudderstack/CHANGELOG.md
  • packages/server/destinations/rudderstack/package.json
  • packages/server/destinations/segment/CHANGELOG.md
  • packages/server/destinations/segment/package.json
  • packages/server/destinations/slack/CHANGELOG.md
  • packages/server/destinations/slack/package.json
  • packages/server/destinations/snapchat/CHANGELOG.md
  • packages/server/destinations/snapchat/package.json
  • packages/server/destinations/sqlite/CHANGELOG.md
  • packages/server/destinations/sqlite/package.json
  • packages/server/destinations/tiktok/CHANGELOG.md
  • packages/server/destinations/tiktok/package.json
  • packages/server/destinations/twitter/CHANGELOG.md
  • packages/server/destinations/twitter/package.json
  • packages/server/sources/aws/CHANGELOG.md
  • packages/server/sources/aws/package.json
  • packages/server/sources/express/CHANGELOG.md
  • packages/server/sources/express/package.json
  • packages/server/sources/fetch/CHANGELOG.md
  • packages/server/sources/fetch/package.json
  • packages/server/sources/gcp/CHANGELOG.md
  • packages/server/sources/gcp/package.json
  • packages/server/stores/fs/CHANGELOG.md
  • packages/server/stores/fs/package.json
  • packages/server/stores/gcs/CHANGELOG.md
  • packages/server/stores/gcs/package.json
  • packages/server/stores/s3/CHANGELOG.md
  • packages/server/stores/s3/package.json
  • packages/server/stores/sheets/CHANGELOG.md
  • packages/server/stores/sheets/package.json
  • packages/server/transformers/bot/CHANGELOG.md
  • packages/server/transformers/bot/package.json
  • packages/server/transformers/file/CHANGELOG.md
  • packages/server/transformers/file/package.json
  • packages/server/transformers/fingerprint/CHANGELOG.md
  • packages/server/transformers/fingerprint/package.json
  • packages/transformers/demo/CHANGELOG.md
  • packages/transformers/demo/package.json
  • packages/transformers/ga4/CHANGELOG.md
  • packages/transformers/ga4/package.json
  • packages/transformers/validate/CHANGELOG.md
  • packages/transformers/validate/package.json
  • packages/web/core/CHANGELOG.md
  • packages/web/core/package.json
  • packages/web/destinations/amplitude/CHANGELOG.md
  • packages/web/destinations/amplitude/package.json
  • packages/web/destinations/api/CHANGELOG.md
  • packages/web/destinations/api/package.json
  • packages/web/destinations/clarity/CHANGELOG.md
  • packages/web/destinations/clarity/package.json
  • packages/web/destinations/d8a/CHANGELOG.md
  • packages/web/destinations/d8a/package.json
  • packages/web/destinations/fullstory/CHANGELOG.md
  • packages/web/destinations/fullstory/package.json
  • packages/web/destinations/gtag/CHANGELOG.md
  • packages/web/destinations/gtag/package.json
  • packages/web/destinations/heap/CHANGELOG.md
  • packages/web/destinations/heap/package.json
  • packages/web/destinations/hotjar/CHANGELOG.md
  • packages/web/destinations/hotjar/package.json
  • packages/web/destinations/linkedin/CHANGELOG.md
  • packages/web/destinations/linkedin/package.json
  • packages/web/destinations/matomo/CHANGELOG.md
  • packages/web/destinations/matomo/package.json
  • packages/web/destinations/meta/CHANGELOG.md
  • packages/web/destinations/meta/package.json
  • packages/web/destinations/mixpanel/CHANGELOG.md
  • packages/web/destinations/mixpanel/package.json
  • packages/web/destinations/optimizely/CHANGELOG.md
  • packages/web/destinations/optimizely/package.json
  • packages/web/destinations/piano/CHANGELOG.md
  • packages/web/destinations/piano/package.json
  • packages/web/destinations/pinterest/CHANGELOG.md
  • packages/web/destinations/pinterest/package.json
  • packages/web/destinations/piwikpro/CHANGELOG.md
  • packages/web/destinations/piwikpro/package.json
  • packages/web/destinations/plausible/CHANGELOG.md
  • packages/web/destinations/plausible/package.json
  • packages/web/destinations/posthog/CHANGELOG.md
  • packages/web/destinations/posthog/package.json
  • packages/web/destinations/segment/CHANGELOG.md
  • packages/web/destinations/segment/package.json
  • packages/web/destinations/snowplow/CHANGELOG.md
  • packages/web/destinations/snowplow/package.json
  • packages/web/destinations/tiktok/CHANGELOG.md
  • packages/web/destinations/tiktok/package.json
  • packages/web/sources/browser/CHANGELOG.md
  • packages/web/sources/browser/package.json
  • packages/web/sources/cmps/cookiefirst/CHANGELOG.md
  • packages/web/sources/cmps/cookiefirst/package.json
  • packages/web/sources/cmps/cookiepro/CHANGELOG.md
  • packages/web/sources/cmps/cookiepro/package.json
  • packages/web/sources/cmps/usercentrics/CHANGELOG.md
  • packages/web/sources/cmps/usercentrics/package.json
  • packages/web/sources/dataLayer/CHANGELOG.md
  • packages/web/sources/dataLayer/package.json
  • packages/web/sources/demo/CHANGELOG.md
  • packages/web/sources/demo/package.json
  • packages/web/sources/session/CHANGELOG.md
  • packages/web/sources/session/package.json
  • website/CHANGELOG.md
  • website/package.json

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:

  • Review on demand using usage pricing
📝 Walkthrough

Walkthrough

The PR adds observe-session connectivity across core, collector, bundling, and CLI packages; changes ingest posts to versioned envelopes; tightens contract validation; adds cookie-domain session storage; updates preview output and documentation; and refreshes release metadata and workflow action pins.

Changes

Observe connectivity

Layer / File(s) Summary
Observe contracts and ingest protocol
packages/core/src/observeConnect.ts, packages/core/src/batchedPoster.ts, packages/core/src/schemas/*, packages/core/src/preview.ts
Adds observe configuration types, credential parsing, environment loading, versioned ingest envelopes, release provenance, and preview credential storage.
Collector observe installation
packages/collector/src/flow.ts, packages/collector/src/__tests__/observe-wiring.test.ts
Installs web or server observation before source initialization, handles credentials and 401 cleanup, stamps records, and preserves custom observers.
Bundle observe-connect wiring
packages/cli/src/commands/bundle/*
Bakes public url and binding values into generated artifacts, warns on incomplete pairs, and removes baked observer and token machinery.
Observe session CLI and API contracts
packages/cli/src/commands/observe/*, packages/cli/src/cli.ts, packages/cli/openapi/*, packages/cli/src/types/api.gen.d.ts
Adds walkeros observe start with session creation, polling, rendering, authentication handling, timeout behavior, JSON output, and updated preview/session response shapes.
Preview output and observe documentation
packages/cli/src/commands/previews/*, website/docs/getting-started/*, skills/walkeros-using-cli/*, .changeset/observe-connect-foundation.md
Removes raw preview-token output and documents integrated, bundled, server, and custom-observer setup.

Contract validation

Layer / File(s) Summary
Canonical contract validation
packages/cli/src/__tests__/unit/validate/contract.test.ts, website/docs/apps/cli.mdx, website/docs/getting-started/flow/contract.mdx, .changeset/cli-contract-shape-validation.md
Updates validation coverage and documentation for named-entry contracts, flat-shape rejection, unknown-key warnings, and tagging/schema type checks.

Session cookie storage

Layer / File(s) Summary
Cookie-domain storage support
packages/web/core/src/storage.ts, packages/web/sources/session/src/**/*, website/docs/guides/session.mdx, website/docs/core/web.mdx
Adds cookie-domain forwarding and deletion, accepts cookie storage settings, and documents parent-domain sharing across subdomains.

Release and workflow maintenance

Layer / File(s) Summary
Release metadata and automation pins
.changeset/*, .github/workflows/*, package.json
Updates release notes, workflow action revisions, and the @walkeros/config development dependency.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 59.62% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is too vague and issue-number driven; it doesn’t clearly describe the main changes in the PR. Rename it to a concise, specific summary of the primary change, such as adding unified observe/session flows or the main feature being shipped.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 696-unified-session

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: 6

🤖 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 @.github/workflows/website.yml:
- Line 35: Add persist-credentials: false to each actions/checkout step in
.github/workflows/website.yml (35-35), .github/workflows/storybook.yml (27-27),
and .github/workflows/tagging.yml (23-23), preserving the existing checkout
configuration.

In `@packages/cli/src/commands/bundle/bundler.ts`:
- Around line 1978-1979: Update the connect-config conversion near the
trimmedUrl/trimmedBinding return to preserve the configured level and sample
fields when constructing the Flow.Observe result, including level: 'off'. Update
the corresponding observe codegen test coverage to assert these controls survive
conversion and prevent telemetry defaults from overriding explicit settings.

In `@packages/cli/src/commands/observe/index.ts`:
- Around line 91-95: Update the timeout parsing and polling loop around
getObserveSession to require a fully valid numeric timeout instead of accepting
trailing text or truncating fractional values. In the loop, calculate the
remaining time before sleeping and cap the polling delay to that remainder so no
sleep crosses the deadline; return the session once the deadline is reached.

In `@packages/collector/src/flow.ts`:
- Around line 158-231: Apply observe.level consistently in the observe
initialization flow: in the web arm, return immediately for level 'off' before
reading credentials, writing storage, or creating an observer; in the server
arm, ensure level 'trace' installs observeLevel so destination-call capture is
enabled. Update the wiring tests to cover web level 'off' and server level
'trace', preserving existing behavior for other levels.

In `@packages/core/src/batchedPoster.ts`:
- Around line 205-209: Filter caller headers case-insensitively in the header
construction around batchedPoster request options, removing names whose
name.toLowerCase() is authorization or content-type before adding the fixed
values. In packages/core/src/batchedPoster.ts lines 205-209, preserve only the
fixed reserved headers; in packages/core/src/__tests__/batchedPoster.test.ts
lines 231-259, add lowercase authorization and content-type collision cases
verifying the fixed values are the only reserved headers.

In `@packages/core/src/observeConnect.ts`:
- Around line 87-88: Update the WALKEROS_OBSERVE_LEVEL handling in
observeConnect so an explicitly provided value that fails isLevel is rejected
rather than ignored; preserve the existing assignment for valid levels and
ensure invalid configuration cannot fall back to active standard observation.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: bad9029f-994b-46de-94ff-196d31e596ff

📥 Commits

Reviewing files that changed from the base of the PR and between 09968c9 and 2d6ab82.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (42)
  • .changeset/cli-contract-shape-validation.md
  • .changeset/collector-push-dropped-flag.md
  • .changeset/observe-connect-foundation.md
  • .github/workflows/release.yml
  • .github/workflows/storybook.yml
  • .github/workflows/tagging.yml
  • .github/workflows/test.yml
  • .github/workflows/website.yml
  • package.json
  • packages/cli/src/__tests__/integration/trace-loop.test.ts
  • packages/cli/src/__tests__/unit/bundle/preview-codegen.test.ts
  • packages/cli/src/__tests__/unit/bundle/wrap.test.ts
  • packages/cli/src/__tests__/unit/validate/contract.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/bundle/__tests__/observe-codegen.test.ts
  • packages/cli/src/commands/bundle/bundler.ts
  • packages/cli/src/commands/bundle/wrap.ts
  • packages/cli/src/commands/observe/__tests__/observe.test.ts
  • packages/cli/src/commands/observe/index.ts
  • packages/cli/src/commands/validate/__tests__/contract.test.ts
  • packages/collector/src/__tests__/observe-wiring.test.ts
  • packages/collector/src/flow.ts
  • packages/core/src/__tests__/batchedPoster-seq-split.test.ts
  • packages/core/src/__tests__/batchedPoster.test.ts
  • packages/core/src/__tests__/observeConnect.test.ts
  • packages/core/src/__tests__/preview-activator.test.ts
  • packages/core/src/__tests__/preview.test.ts
  • packages/core/src/batchedPoster.ts
  • packages/core/src/index.ts
  • packages/core/src/observeConnect.ts
  • packages/core/src/preview.ts
  • packages/core/src/schemas/collector.ts
  • packages/core/src/schemas/flow.ts
  • packages/core/src/types/collector.ts
  • packages/core/src/types/flow.ts
  • packages/core/src/types/telemetry.ts
  • skills/walkeros-using-cli/SKILL.md
  • website/docs/apps/cli.mdx
  • website/docs/getting-started/flow/contract.mdx
  • website/docs/getting-started/modes/bundled.mdx
  • website/docs/getting-started/modes/integrated.mdx
  • website/docs/getting-started/observe.mdx
💤 Files with no reviewable changes (1)
  • packages/cli/src/commands/validate/tests/contract.test.ts

TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Disable persisted checkout credentials in deployment workflows.

These jobs do not need Git credentials after checkout, so retaining the token exposes it to subsequent build/deployment commands. Add persist-credentials: false at each checkout:

  • .github/workflows/website.yml#L35-L35: harden the website and PR-preview deployment job.
  • .github/workflows/storybook.yml#L27-L27: harden the Storybook deployment job.
  • .github/workflows/tagging.yml#L23-L23: harden the tagging deployment job.
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 35-35: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

📍 Affects 3 files
  • .github/workflows/website.yml#L35-L35 (this comment)
  • .github/workflows/storybook.yml#L27-L27
  • .github/workflows/tagging.yml#L23-L23
🤖 Prompt for 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.

In @.github/workflows/website.yml at line 35, Add persist-credentials: false to
each actions/checkout step in .github/workflows/website.yml (35-35),
.github/workflows/storybook.yml (27-27), and .github/workflows/tagging.yml
(23-23), preserving the existing checkout configuration.

Source: Linters/SAST tools

Comment thread packages/cli/src/commands/bundle/bundler.ts Outdated
Comment thread packages/cli/src/commands/observe/index.ts Outdated
Comment on lines +158 to +231
const observe = initConfig.observe;
if (!observe) return;

const flowId = instance.name ?? 'default';

if ('binding' in observe) {
// Web arm: the credential arrives out-of-band via the elbObserve URL
// param (or the storage slot the preview activator ferries it into).
// Truly absent means zero work: no parse, no storage write, no observer.
const param = readObserveParam();
const raw = param ?? readObserveSlot();
if (!raw) return;

// A present-but-broken credential is warned, never silently dropped;
// only the truly-absent case above is silent (zero-work contract).
const credential = parseObserveCredential(raw);
if (!credential) {
if (param === null) {
// Slot-sourced garbage: stored state clears on its own failure, so
// self-heal instead of warning on every pageview.
instance.logger.warn('observe: malformed stored credential cleared');
clearObserveSlotIf(raw);
} else {
// URL-sourced garbage never touches stored state (anti-griefing).
instance.logger.warn('observe: malformed credential ignored');
}
return;
}
if (credential.pb !== observe.binding) {
instance.logger.warn(
'observe: credential binding mismatch, credential ignored',
);
return;
}

writeObserveSlot(raw);
// The credential is persisted; a URL-borne copy is now redundant and,
// being a bearer credential, must not linger in the address bar.
if (param !== null) stripObserveParam();

let observer: ObserverFn | undefined;
const post = createBatchedPoster({
url: `${observe.url}/ingest/${credential.ses}`,
token: credential.secret,
headers: { 'X-Walkeros-Binding': observe.binding },
onStatus: (status) => {
if (status !== 401) return;
// The observer rejected this credential (session ended or token
// revoked): self-heal the slot -- CAS, only while it still holds
// exactly this credential -- and detach, so posting stops and the
// next pageview is back on the silent zero-work path.
clearObserveSlotIf(raw);
if (observer) instance.observers.delete(observer);
},
});
// Baked scoping: a wrap (e.g. a preview artifact) may carry a public
// flowId/level/sample on the connect config. flowId overrides the local
// config name on every posted record so they land under the platform's
// flow id; a baked level also drives the collector-wide capture supplier
// so destination call capture runs at trace.
observer = createTelemetryObserver(
withFlowId(withRelease(post, instance.release), observe.flowId),
{
flowId: observe.flowId ?? flowId,
...(observe.level !== undefined ? { level: observe.level } : {}),
...(observe.sample !== undefined ? { sample: observe.sample } : {}),
},
);
instance.observers.add(observer);
const bakedLevel = observe.level;
if (bakedLevel !== undefined) {
instance.observeLevel = () => bakedLevel;
}
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Apply observe.level consistently across both runtime arms.

The web arm does not honor off, while the server arm never installs observeLevel for trace; this leaves web observation doing unnecessary credential/observer work and server traces missing destination-call capture.

Proposed fix
   const observe = initConfig.observe;
-  if (!observe) return;
+  if (!observe || observe.level === 'off') return;

   const flowId = instance.name ?? 'default';

   if ('binding' in observe) {
     // Existing web setup...
   }

   // Server arm: the config trio is the credential; attach directly.
-  // 'off' opts out entirely (no observer, zero emit-path work).
-  if (observe.level === 'off') return;
+  const serverLevel = observe.level;
+  if (serverLevel !== undefined) {
+    instance.observeLevel = () => serverLevel;
+  }
   instance.observers.add(

Please also cover web level: 'off' and server level: 'trace' in the wiring tests.

Also applies to: 234-248

🤖 Prompt for 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.

In `@packages/collector/src/flow.ts` around lines 158 - 231, Apply observe.level
consistently in the observe initialization flow: in the web arm, return
immediately for level 'off' before reading credentials, writing storage, or
creating an observer; in the server arm, ensure level 'trace' installs
observeLevel so destination-call capture is enabled. Update the wiring tests to
cover web level 'off' and server level 'trace', preserving existing behavior for
other levels.

Comment thread packages/core/src/batchedPoster.ts Outdated
Comment thread packages/core/src/observeConnect.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Preview deployed

https://walkeros-io.b-cdn.net/preview/pr-697/

@github-actions

Copy link
Copy Markdown
Contributor

📦 Pre-release published (next)

Packages

Install: npm i @walkeros/core@next

🐳 Docker images published

  • walkeros/flow:4.3.1-next-1784373088875 (:next)
  • walkeros/cli:4.3.1-next-1784373088875 (:next)

Docker: docker pull walkeros/flow:next

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
website/docs/getting-started/observe.mdx (2)

50-55: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Use a non-credential placeholder in the activation URL.

The page states that credentials never live in committed artifacts, but this example contains a credential-shaped literal (obsw_pb_x.ses_9.sec_1). Use ?elbObserve=<session-credential> instead to avoid ambiguity and accidental reuse.

🤖 Prompt for 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.

In `@website/docs/getting-started/observe.mdx` around lines 50 - 55, Update the
activation URL example in the CodeSnippet to use the non-credential placeholder
`?elbObserve=<session-credential>` instead of the credential-shaped literal,
while preserving the surrounding URL and documentation.

119-123: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the contradictory server example comment.

The comment says observe becomes configured when all three variables are set, “then zero observation work” occurs. This reverses the documented behavior below; observation should be enabled when the full trio is present, and disabled when it is absent.

Proposed wording
-  // undefined unless all three variables are set: then zero observation work
+  // undefined unless all three variables are set; otherwise, no observation work
🤖 Prompt for 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.

In `@website/docs/getting-started/observe.mdx` around lines 119 - 123, Update the
inline comment beside observeFromEnv in the startFlow example to state that
observation is enabled when all three environment variables are set and disabled
when they are absent, matching the documented behavior below.
packages/cli/src/commands/observe/index.ts (1)

119-136: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Validate programmatic polling numbers before entering the loop.

The exported API accepts NaN, Infinity, and negative values. These can produce a tight request loop or a deadline that never expires.

Proposed fix
 export async function waitForObserveSessionSettled(options: {
   projectId?: string;
   flowId: string;
   sessionId: string;
   timeoutMs: number;
   pollIntervalMs: number;
 }): Promise<ObserveSessionResponse> {
+  if (!Number.isFinite(options.timeoutMs) || options.timeoutMs < 0) {
+    throw new Error('timeoutMs must be a finite, non-negative number');
+  }
+  if (
+    !Number.isFinite(options.pollIntervalMs) ||
+    options.pollIntervalMs < 0
+  ) {
+    throw new Error('pollIntervalMs must be a finite, non-negative number');
+  }
+
   const deadline = Date.now() + options.timeoutMs;
🤖 Prompt for 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.

In `@packages/cli/src/commands/observe/index.ts` around lines 119 - 136, Validate
options.timeoutMs and options.pollIntervalMs at the start of
waitForObserveSessionSettled, rejecting NaN, non-finite, or negative values
before the polling loop begins; preserve normal polling behavior for valid
non-negative finite numbers.
packages/cli/openapi/spec.json (1)

2495-2526: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Remove or deprecate force from CreateObserveSessionRequest
packages/cli/openapi/spec.json:2495-2526 still exposes force alongside replace, but the CLI now only sends replace. If force is kept for compatibility, mark it deprecated and document the overlap; otherwise drop it from the schema and regenerated client types.

🤖 Prompt for 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.

In `@packages/cli/openapi/spec.json` around lines 2495 - 2526, Update the
CreateObserveSessionRequest schema to remove the obsolete force property, since
callers now use replace; regenerate any client types derived from this OpenAPI
definition so force is no longer exposed. If compatibility requires retaining
force, instead mark it deprecated and document its overlap with replace.
🤖 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 `@packages/cli/src/commands/bundle/bundler.ts`:
- Around line 1991-1993: Update the sample validation in the bundling logic
around the sample object construction to accept only finite numbers in the
inclusive range [0, 1], omitting out-of-range values while preserving valid
samples. Add boundary and out-of-range coverage in observe-codegen.test.ts.

In `@packages/cli/src/commands/observe/__tests__/observe.test.ts`:
- Around line 566-582: Reset the console output spies inside each iteration of
the invalid-timeout loop before calling observeStartCommand, so
consoleErrorText() only reflects the current case and each timeout independently
verifies its own “Invalid --timeout” error.

---

Outside diff comments:
In `@packages/cli/openapi/spec.json`:
- Around line 2495-2526: Update the CreateObserveSessionRequest schema to remove
the obsolete force property, since callers now use replace; regenerate any
client types derived from this OpenAPI definition so force is no longer exposed.
If compatibility requires retaining force, instead mark it deprecated and
document its overlap with replace.

In `@packages/cli/src/commands/observe/index.ts`:
- Around line 119-136: Validate options.timeoutMs and options.pollIntervalMs at
the start of waitForObserveSessionSettled, rejecting NaN, non-finite, or
negative values before the polling loop begins; preserve normal polling behavior
for valid non-negative finite numbers.

In `@website/docs/getting-started/observe.mdx`:
- Around line 50-55: Update the activation URL example in the CodeSnippet to use
the non-credential placeholder `?elbObserve=<session-credential>` instead of the
credential-shaped literal, while preserving the surrounding URL and
documentation.
- Around line 119-123: Update the inline comment beside observeFromEnv in the
startFlow example to state that observation is enabled when all three
environment variables are set and disabled when they are absent, matching the
documented behavior below.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1dad4f4e-66ae-4175-a138-860d834f3cbf

📥 Commits

Reviewing files that changed from the base of the PR and between 2d6ab82 and 747e42f.

📒 Files selected for processing (27)
  • .changeset/retire-telemetry-bake.md
  • .github/workflows/storybook.yml
  • .github/workflows/tagging.yml
  • .github/workflows/website.yml
  • packages/cli/openapi/spec.json
  • packages/cli/src/__tests__/unit/bundle/bundler-codegen.test.ts
  • packages/cli/src/__tests__/unit/bundle/preview-codegen.test.ts
  • packages/cli/src/__tests__/unit/bundle/wrap.test.ts
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/bundle/__tests__/bundler.test.ts
  • packages/cli/src/commands/bundle/__tests__/observe-codegen.test.ts
  • packages/cli/src/commands/bundle/bundler.ts
  • packages/cli/src/commands/bundle/wrap.ts
  • packages/cli/src/commands/observe/__tests__/observe.test.ts
  • packages/cli/src/commands/observe/index.ts
  • packages/cli/src/commands/previews/__tests__/output.test.ts
  • packages/cli/src/commands/previews/__tests__/previews.test.ts
  • packages/cli/src/commands/previews/output.ts
  • packages/cli/src/types/api.gen.d.ts
  • packages/collector/src/__tests__/observe-wiring.test.ts
  • packages/collector/src/flow.ts
  • packages/core/src/__tests__/batchedPoster.test.ts
  • packages/core/src/__tests__/observeConnect.test.ts
  • packages/core/src/batchedPoster.ts
  • packages/core/src/observeConnect.ts
  • skills/walkeros-using-cli/commands-reference.md
  • website/docs/getting-started/observe.mdx
💤 Files with no reviewable changes (1)
  • packages/cli/src/commands/bundle/tests/bundler.test.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • .github/workflows/storybook.yml
  • .github/workflows/tagging.yml
  • packages/core/src/tests/observeConnect.test.ts
  • packages/core/src/observeConnect.ts
  • packages/core/src/tests/batchedPoster.test.ts
  • packages/cli/src/cli.ts
  • .github/workflows/website.yml
  • packages/collector/src/tests/observe-wiring.test.ts
  • packages/collector/src/flow.ts
  • packages/core/src/batchedPoster.ts

Comment thread packages/cli/src/commands/bundle/bundler.ts Outdated
Comment thread packages/cli/src/commands/observe/__tests__/observe.test.ts
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Stable release published

Packages

Install: npm i @walkeros/core@latest

🐳 Docker images published

  • walkeros/flow:4.3.1 (:latest)
  • walkeros/cli:4.3.1 (:latest)

Docker: docker pull walkeros/flow:latest

@alexanderkirtzel
alexanderkirtzel merged commit c42069b into main Jul 20, 2026
1 check passed
@alexanderkirtzel
alexanderkirtzel deleted the 696-unified-session branch July 20, 2026 09:07
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.

unified session

1 participant