Skip to content

Sync scoped attachments and runtime budget fixes - #233

Open
Luhaozhu wants to merge 1 commit into
sync/ce-20261116-scoped-uploadsfrom
sync/ce-20261116-kb-runtime
Open

Luhaozhu wants to merge 1 commit into
sync/ce-20261116-scoped-uploadsfrom
sync/ce-20261116-kb-runtime

Conversation

@Luhaozhu

Copy link
Copy Markdown
Contributor

Purpose and behavior

  • Before: Agent-scoped API keys could upload files into a chat but could not include those files in a response request. Long inputs repeatedly recalculated size while trimming. The knowledge document UI could show an empty list after a failed chunk request.
  • After: A scoped key can attach a live file owned by its account and bound to its chat. Budget fitting uses bounded probes or incrementally accounts for removed entries. The chunk list shows a retryable error on failure and an empty state after a successful empty response.

Change walkthrough

  • Flow: src/backend/core/auth/agent_api.py checks artifact ownership and chat scope before admission. src/backend/core/infra/budget_search.py supplies the bounded prefix search used by text truncation and recursive splitting. The chunk route and CE provider in src/backend/features/knowledge/ feed the existing frontend detail view in src/frontend/src/components/catalog/CatalogPanel.tsx.
  • Decisions: Reuse the existing session binding and visitor attachment path. Keep the CE disabled provider explicit. This generated sync is stacked on Sync scoped uploads, skill publication, and sandbox provider fixes #232 because it depends on scoped uploads binding artifacts to the chat.

Risk and compatibility

  • Risk: high
  • Boundaries: The diff contains 18 CE files and no schema migration. External providers and ontology code remain outside the CE tree. Existing attachment requests using ordinary authentication keep their existing path.
  • Human review: Verify that scoped keys cannot attach files from another owner's account or conversation. Review token-budget behavior for representative multilingual input.

Verification

  • Evidence: CE derivation passed runtime-file, excluded-artifact, binary-asset, branding and license gates. Eight CE budget regression tests and the CE frontend chunk-fetch test passed. The upstream targeted backend suite passed all 51 tests, and Git whitespace checks passed.
  • Limits: The CE API-key test module inherits a missing upstream-only fixture from Sync scoped uploads, skill publication, and sandbox provider fixes #232 and does not collect in CE. The attachment checks passed in the upstream suite. A full CE suite and live external-provider testing are outside this verification.

Recovery

  • Steps: Revert this generated sync and redeploy the prior CE build. The revert restores prior request handling and leaves stored chat and attachment records in place.

Review follow-up

Community checklist

  • Maintainer review of the generated sync is pending.
  • Public bilingual documentation is updated in both languages where applicable.
  • CONTRIBUTING.md was read and referenced paths were checked.

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.

1 participant