Skip to content

Add agent conversation context selection - #382

Merged
salman1993 merged 5 commits into
mainfrom
codex/agent-conversation-context
Sep 29, 2026
Merged

salman1993 merged 5 commits into
mainfrom
codex/agent-conversation-context

Conversation

@salman1993

@salman1993 salman1993 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Why

Buzz App has no way to choose whether an agent shares conversation context across a channel or keeps separate context for each thread, although the relay supports both policies.

What changed

  • Add Conversation context to Settings → Agents and Create/Edit Agent, with Entire channel and Each thread choices. Agent forms can inherit the device default.
  • Persist the default and per-agent choice in the native controller, resolve the effective value when starting an agent, pass it to the relay, and restart agents when the effective policy changes.
  • Preserve imported policies until the user explicitly chooses a policy or inheritance. A selected legacy definition or record with no conversation context field means Entire channel; a linked definition takes precedence over its record. An omitted agent edit field preserves the current choice, while explicit null selects inheritance. An omitted defaults edit preserves the saved device choice.
  • Cover defaults, agent editing, import behavior, runtime configuration, and restart detection.

Checks

  • Rust controller library tests at 14efa07f: 110 passed, 1 ignored. Earlier avatar and build-config suites passed (5 and 11 tests).
  • cargo check -p buzz-foundation --tests, cargo fmt --check, and tsc --noEmit passed.
  • Pre-push hook at 14efa07f: 40 related Vitest files (643 tests) and design-system checks passed.
  • git diff --check passed.

Still to verify

  • Exercise Settings → Agents and Create/Edit Agent in the running app. Set Each thread, save, reopen, then confirm the selected value persists. Set an agent to inherit, change the default, and confirm its displayed inherited value updates.
  • With a local relay, start an agent under each policy and verify messages in separate channel threads share or isolate context as selected. Verify a changed policy takes effect after restart.
  • Human app test and agent review are pending. Keep this PR in draft until the repository readiness checklist is complete.

CI follow-up

  • Native agent edits distinguish omitted sessionPolicy (preserve) from explicit null (inherit). Legacy imported definitions and records with an omitted field resolve to Entire channel. Regression tests failed before the fix and pass at 0ccf04a2. Foundation library tests passed with --test-threads=2 (131 passed, 4 intentionally ignored); an earlier concurrent run hit an unrelated host-command test timeout, and that test passed in isolation.
  • The existing model-picker browser journey now scrolls the input into view before choosing a custom option. WebKit failed before this change because the input and popup were above the dialog scrollport; the changed journey passed afterward in both WebKit and Chromium. No browser cases were added or removed.
  • An older Settings caller that omits sessionPolicy no longer resets a saved Each thread default to Entire channel. The regression test failed before the fix and passed at 350419a1.
  • Merged main at ffe93222 into 14efa07f. The only content conflict was in a model-hint test: main’s consolidated cases stay, along with this PR’s conversation-context fixture. Five affected frontend test files passed (163 tests).
  • The pre-push gate passed at 14efa07f (40 Vitest files, 643 tests, design checks). Hosted CI is running on this merge head; DCO passed. The previous head 350419a1 passed the required check, Rust, JavaScript, browser measurements, all Chromium and WebKit journey shards, DCO, Semgrep, and zizmor. Windows native validation was skipped.

Generated with Codex

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 marked this pull request as ready for review September 29, 2026 00:58
@salman1993
salman1993 requested review from a team, comp615 and wesbillman as code owners September 29, 2026 00:58
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T02:57:34.942470Z 350419a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f71ce8d43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/agent-controller/src/config.rs Outdated

@wesbillman wesbillman left a comment

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.

Star Lord automated source review

Published through Wes’s account. Head: 5f71ce8d43bbfabe8393797bcd2c4d5f05e43ea2; base: 2dd479666ca5bd40166b7e3e79cf3fb0872baa28. COMMENT only—not approval or merge authorization.

One actionable P2 finding is inline: preserve legacy Channel semantics when the serialized policy field is omitted. Mantis’s independent native review corroborated the omitted-field cases after checking the legacy serializer and resolver. No additional actionable defect found in the reviewed UI/draft/IPC, effective-default, launch-environment or restart paths.

Scope and design

  • Reviewed all 23 changed files and relevant callers, persistence/import lifecycle, explicit inheritance, create/duplicate/edit flows, reserved runtime environment and effective restart comparison. Confirmed the session-policy consumer in bundled block/buzz revision 48884848f566d02c42ce07636636c4ad5f164c27, including conversation-scoped DMs.
  • The change reuses the shared Select and existing controller/defaults/restart owners; no competing lifecycle machinery. Minimalness 9/10, elegance 9/10, correctness 8/10 until the inline import defect is fixed.
  • Error/retry was assessed separately from success/cancel: source preserves failed-save drafts and existing status/retry/close controls. Actual keyboard focus, scrolling and native recovery remain unexercised here.
  • Public-material inspection: repository is public; description, both commit records/attribution and changed source/tests inspected. No actionable disclosure finding. The description has no image attachments.

Validation evidence and limits

Source-only: neither reviewer executed PR code, tests, builds, installs or app workflows. The immutable 1,672-blob source snapshot was checked against Git objects; no dirty-worktree inputs were used.

One hosted CI snapshot reports success for JavaScript (5,053 tests across 418 files), Rust/tool integration, browser measurements, all six Chromium/WebKit journey shards, and CI required; DCO also passed. That run tested merge checkout 64ddfe492f5e8e5c572e56161855aeaa259e8bbf, this head into 423f7215e124aa68b828c85f9040703a3fe9913d, not the review base above. Windows native validation was skipped. The browser change adds scrolling before an existing selection and adds/removes no cases or assertions.

Green hosted checks do not establish native save/reopen behavior, attended agent restarts, real channel/thread sharing or isolation, or human acceptance. Those remain unverified by this review; the PR description also lists them as pending. This review does not attest the repository readiness checklist.

Comment thread crates/agent-controller/src/config.rs Outdated
@salman1993
salman1993 marked this pull request as draft September 29, 2026 01:13
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 marked this pull request as ready for review September 29, 2026 01:19
@salman1993
salman1993 marked this pull request as draft September 29, 2026 01:20

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ccf04a2c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/agent-controller/src/agent_defaults.rs Outdated
@salman1993
salman1993 marked this pull request as ready for review September 29, 2026 01:25
@salman1993
salman1993 marked this pull request as draft September 29, 2026 01:34
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 marked this pull request as ready for review September 29, 2026 02:53
Signed-off-by: Salman Mohammed <smohammed@squareup.com>

@wesbillman wesbillman left a comment

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.

Star Lord automated source review (via Wes’s account)

No new actionable findings in this bounded follow-up. Reviewed head 14efa07f95eacfd7576c0d2e635c5295d30ecd9d against base ffe932228caee3ee43d9a766b04cd8f67a9a3cc7. COMMENT only—not approval or merge authorization.

The previously reported policy-preservation defects are addressed in source:

  • Legacy imports: config.rs:221–241 selects the linked definition object before the record and interprets its omitted policy as Channel. New agents still inherit, and explicit inheritance overrides imported policy. This resolves the prior import finding and matches the pinned legacy serializer/resolver.
  • Agent edits: the presence-aware deserializer (config.rs:29–33,114–116) distinguishes omitted policy from explicit null; apply() preserves the former and selects inheritance for the latter. The store regression exercises both real JSON payload shapes.
  • Default edits: agent_defaults.rs:65–67,98 preserves the saved default when an older caller omits the field. The new regression checks omission followed by an explicit replacement.

Traced these repairs through import retention, snapshot projection, atomic save, effective launch settings and the existing restart-on-save comparison. The merge resolution keeps main’s consolidated model-hint coverage and this feature’s policy fixture. No new lifecycle owner or speculative abstraction is introduced. Minimalness 9/10, elegance 9/10, correctness 9/10 for this source-review scope.

Error/retry was assessed separately from success/cancel: failed saves retain drafts and require refreshed status before retry; successful saves clear drafts and report restart failures separately. These fixes add no focus transitions; actual keyboard focus, scrolling and native recovery remain unexercised.

Public-material check: repository is public; inspected the description, feature commit messages/attribution, changed source/tests and merge resolution. No actionable disclosure finding; the description contains no attached images. No dirty-worktree inputs were used; the extracted head snapshot’s 1,688 blobs were verified against Git objects.

Validation limits: source-only—no PR code, tests, builds, installs or app workflows executed. Added regression assertions were inspected, not run. Current hosted CI was not assessed in this follow-up. Native save/reopen, live channel/thread isolation, attended restarts and human acceptance remain unverified by this review; the description also lists app/relay checks as pending. This does not attest the repository readiness checklist.

@salman1993
salman1993 merged commit c37e83b into main Sep 29, 2026
16 checks passed
@salman1993
salman1993 deleted the codex/agent-conversation-context branch September 29, 2026 16:45
johnmatthewtennant pushed a commit that referenced this pull request Sep 29, 2026
…t-update-drafts

* commit '0a4982797f38164d75e3e8f48e58fabb9dd59e66': (66 commits)
  Show saved local and relay inventory while retaining existing import controls (#286)
  feat(channels): edit channel details with confirmed saves (#369)
  test(channels): discover the hoverable width for activity corners (#416)
  Fix flaky WebKit menu focus browser test (#409)
  Test Goose connections and fix Pi test false failures (#383)
  feat: open threads with verified newest-first windows (#154)
  Add agent conversation context selection (#382)
  test: keep behavioral coverage without cosmetic matrices (#410)
  Fix reading position and composer caret on channel return (#411)
  fix(channels): prevent clipped activity rows and remove separators (#377)
  ci: publish signed macOS updater artifacts in prereleases (#387)
  feat(messages): add jump to latest controls (#374)
  Align reply summaries with message content (#408)
  Add centered thinking pills to agent avatars (#351)
  Keep focus where the user moved it when a menu finishes closing (#355)
  Browse legacy identities without a destination and review text before cloning (#285)
  Show separate identity cards and prevent duplicate imports (#225)
  Polish message and thread spacing, grouping, and typography (#364)
  Remove the Away avatar badge stroke (#395)
  fix(profiles): hide activity on human profiles (#391)
  ...

Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz>
johnmatthewtennant pushed a commit that referenced this pull request Sep 29, 2026
* origin/main: (25 commits)
  Show saved local and relay inventory while retaining existing import controls (#286)
  feat(channels): edit channel details with confirmed saves (#369)
  test(channels): discover the hoverable width for activity corners (#416)
  Fix flaky WebKit menu focus browser test (#409)
  Test Goose connections and fix Pi test false failures (#383)
  feat: open threads with verified newest-first windows (#154)
  Add agent conversation context selection (#382)
  test: keep behavioral coverage without cosmetic matrices (#410)
  Fix reading position and composer caret on channel return (#411)
  fix(channels): prevent clipped activity rows and remove separators (#377)
  ci: publish signed macOS updater artifacts in prereleases (#387)
  feat(messages): add jump to latest controls (#374)
  Align reply summaries with message content (#408)
  Add centered thinking pills to agent avatars (#351)
  Keep focus where the user moved it when a menu finishes closing (#355)
  Browse legacy identities without a destination and review text before cloning (#285)
  Show separate identity cards and prevent duplicate imports (#225)
  Polish message and thread spacing, grouping, and typography (#364)
  Remove the Away avatar badge stroke (#395)
  fix(profiles): hide activity on human profiles (#391)
  ...

Signed-off-by: Sol <49aa1f65411fd096d2e2ec144f1e7aa36fdc76d1b907cfdf7be000c66f9d3b8e@buzz.block.builderlab.xyz>

# Conflicts:
#	src/bundled/agents/AgentsPage.test.tsx
#	src/bundled/agents/AgentsPage.tsx
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.

2 participants