Skip to content

feat: tell the DSS which participant and channel each chat comes from [#192] - #7

Merged
Bhavesh-Suvalaka merged 9 commits into
mainfrom
feat/192-sender-and-channel
Oct 22, 2026
Merged

Bhavesh-Suvalaka merged 9 commits into
mainfrom
feat/192-sender-and-channel

Conversation

@Bhavesh-Suvalaka

Copy link
Copy Markdown
Contributor

What

  • Each deployment now sends its sender id to the DSS as context.senderId. It is set by EXPERIENCE_API_SENDER_ID, has no default, and the app will not start without it.
  • The client may now say which channel a chat comes from (channel). Only web is accepted. A missing or null channel uses the deployment default (EXPERIENCE_API_CHANNEL); any other value gets a 422, and nothing is sent to the DSS.
  • For local runs, settings also read .env. Copy .env.example. A real environment variable always wins, and .env never goes into the image.
  • The contract (§4, §7, §8.3) is updated first, so the web client can build against it.

Why

Many Experience API deployments will share one DSS. The DSS needs to know which network participant each chat comes from, and later use that to choose providers. The channel moves from fixed config to each request, so one deployment can serve more than one channel.

The sender id is a plain label for now. Proving it is planned in OpenAgriNet/engineering-tracker#217.

Before you deploy

  • Every deployment must set EXPERIENCE_API_SENDER_ID.
  • A deployment with EXPERIENCE_API_CHANNEL set to anything but web will no longer start.
  • The DSS change ignores fields it does not know, so either service can ship first.

Testing

  • uv run ruff check . && uv run ruff format --check . && uv run pyright && uv run vulture && uv run pytest: all pass, 127 tests, 18 new.
  • podman compose config with an env file shows the sender id passed through.

Spec: docs/.agent/specs/192-sender-and-channel.md

Relates to OpenAgriNet/engineering-tracker#192

🤖 Generated with Claude Code

Bhavesh-Suvalaka and others added 8 commits October 21, 2026 14:43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…192]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
history: list[HistoryItem]
language: Language
location: Location | None = None
# Missing or null: the deployment's default, filled in by the mapping.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am not able to understand this comment 😅
i thought null is missing and missing is null

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated :)

Comment thread src/experience_api/settings.py Outdated
Comment on lines +28 to +31
# The network participant this deployment serves, sent to the DSS as
# `context.senderId` (contract §7). No default: a deployment that forgets
# it must not start as someone else. The network registry owns its format.
# Trimmed, since a stray space is a copy-paste slip; blank after that fails.

@RohanReddy44 RohanReddy44 Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# The network participant this deployment serves, sent to the DSS as
# `context.senderId` (contract §7). No default: a deployment that forgets
# it must not start as someone else. The network registry owns its format.
# Trimmed, since a stray space is a copy-paste slip; blank after that fails.

IMO this is part of architecture/design found in docs or how the system works. The comment duplicates it and adds more burden to the reader when they already know about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree, removed

Comment thread src/experience_api/settings.py Outdated
Comment on lines +21 to +24
# `extra="ignore"`: `.env` is shared with Compose, which reads keys of its
# own (`EXPERIENCE_API_HOST_PORT`). Unknown environment variables were
# always ignored; this makes `.env` behave the same.
model_config = SettingsConfigDict(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# `extra="ignore"`: `.env` is shared with Compose, which reads keys of its
# own (`EXPERIENCE_API_HOST_PORT`). Unknown environment variables were
# always ignored; this makes `.env` behave the same.
model_config = SettingsConfigDict(
model_config = SettingsConfigDict(

We could rely on git history/blame to reason the change for "ignore" instead of a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed

Drop the extra="ignore" and sender id comments; the docs and git history
hold that detail. Reword the channel comment: an absent key and an
explicit null both mean the deployment default.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Bhavesh-Suvalaka
Bhavesh-Suvalaka merged commit 260c636 into main Oct 22, 2026
3 checks passed
@Bhavesh-Suvalaka
Bhavesh-Suvalaka deleted the feat/192-sender-and-channel branch October 22, 2026 05:34
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.

3 participants