Skip to content

feat(app-logic): async session extension context section with prompt language - #527

Merged
smart-ssh-coordinator[bot] merged 1 commit into
developfrom
issue-526-async-context-section
Oct 14, 2026
Merged

smart-ssh-coordinator[bot] merged 1 commit into
developfrom
issue-526-async-context-section

Conversation

@smart-ssh-coder

Copy link
Copy Markdown
Contributor

Closes #526

Summary

SessionExtension::context_section is now #[async_trait] and receives the session's PromptLanguage; append_extension_section is async and both call sites await it. Order, redact-then-fence and the untrusted-content flag are unchanged.

Acceptance Criteria

  • Async trait method with scope + language, default None: done.
  • Language forwarded: new test (De/En texts); verified it fails when the language is not forwarded.
  • Awaiting extension (tokio RwLock): same test.
  • Existing tests converted to async and pass.
  • connect.rs / chat.rs await it: done.
  • Spec 0038 and ADR 0136 updated.

Tests

fmt, clippy -D warnings, app-logic + app-shell tests, workspace build green locally.

Assumptions

No changelog fragment: not user-visible (internal extension API).

Spec

updated 0038

Manual test steps

None (no community extension registered; behaviour unchanged).

🤖 Generated with Claude Code

…language (#526)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@smart-ssh-coordinator smart-ssh-coordinator Bot added the security-review Touches security-critical code: elevated review label Oct 14, 2026

@smart-ssh-reviewer smart-ssh-reviewer 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.

Review

Verdict: approved
Review level: elevated

Blocking

  • none

Non-blocking

  • Windows CI job was still pending at review time; Ubuntu, macOS, browser, audit and startup jobs are green. Merge only on green.
  • Spec 0038 line wrap in the edited paragraph is uneven (cosmetic).

Security checks

  • Order unchanged: core text, heading, then redact, then fence. The diff does not touch redact/fence/untrusted-content flag logic. The return value still feeds notes_present in both callers.
  • No new path around FilterEngine/risk: the hook only returns text. The None/whitespace early returns are unchanged, so a session without an extension is byte-identical.
  • known_secrets, server_removed and group_removed stay sync and unchanged. Redaction of the section still uses the secrets-aware redactor (test kept in async form).
  • Adversarial: an extension returning a secret, whitespace-only text, or text for another server's scope behaves as before. The language argument is parts.language, the same value used for the heading.
  • Tests: the new language/await test asserts the De and En texts and the absence of the other, so it fails if the language is not forwarded. Existing tests converted.
  • Spec 0038 and ADR 0136 updated and describe behaviour. No changelog fragment is fine (internal API).

@smart-ssh-reviewer smart-ssh-reviewer 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.

Review

Verdict: approved
Review level: elevated

Blocking

  • none

Non-blocking

  • Spec 0038 line wrap in the edited paragraph is uneven (cosmetic).

Security checks

  • Order unchanged: core text, heading, then redact, then fence; the untrusted-content flag still comes from the return value in both callers.
  • The hook only returns text, so there is no new path around FilterEngine or risk classification. Early returns for None or whitespace are unchanged, so a session without an extension is unchanged.
  • known_secrets, server_removed and group_removed are unchanged and still sync.
  • Adversarial: a secret in the section, a whitespace-only section, and a section for another server scope behave as before. The language passed is parts.language, the same value as the heading.
  • The new test asserts the De and En texts and that the other is absent, so it fails if the language is not forwarded. It awaits a tokio RwLock.
  • Spec 0038 and ADR 0136 describe the behaviour. CI is fully green at bac114e, including Windows.

@smart-ssh-coordinator
smart-ssh-coordinator Bot merged commit b2dd6ef into develop Oct 14, 2026
7 checks passed
@smart-ssh-coordinator
smart-ssh-coordinator Bot deleted the issue-526-async-context-section branch October 14, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-review Touches security-critical code: elevated review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session extension: pass the prompt language to the context section and make it async

0 participants