Skip to content

feat(context): unify declarative context reload - #1887

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/unified-context-reload
Jul 30, 2026
Merged

feat(context): unify declarative context reload#1887
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/unified-context-reload

Conversation

@limityan

@limityan limityan commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

Declarative context can change while a BitFun session remains open, but users currently have separate or incomplete refresh paths. Skills can be refreshed independently, while workspace instructions may remain cached until a later lifecycle event. Shared TUI also needs the same behavior without creating a second runtime owner.

What changed

  • Adds one user-facing command: /reload [skills|instructions].
    • /reload refreshes the existing Skill Registry and invalidates the current Session instruction cache.
    • /reload skills and /reload instructions target one existing owner.
    • /reload-skills remains a hidden input compatibility alias only.
  • Supports local Desktop, Embedded CLI, and Shared TUI through one typed Core coordination entry point.
  • Keeps Browser, Dispatch, ACP, and unsupported/remote surfaces fail-closed with a clear local-only message.
  • Resolves runtime-free workspace instructions from existing local or remote workspace services:
    • AGENTS.override.md / AGENTS.md
    • Claude root/local files, unconditional rules, and bounded local imports
    • OpenCode project-local JSON/JSONC instruction entries with exact paths or globs
  • Reuses one JSONC parser across OpenCode agent, command, MCP, and instruction sources.
  • Advances the private Shared TUI IPC protocol to v6 for the combined Session rename and context reload wire.

Behavioral boundary

  • Reload never rewrites the active turn; changes apply to the next message.
  • A cache generation guard prevents an active turn from repopulating invalidated instructions.
  • No watcher, startup re-import, current-turn hot replacement, URL imports, path-scoped Claude rules, source graph, hooks, MCP/model/theme reload, or Plugin Runtime work is included.
  • Skill Registry, Session context, workspace I/O, and ecosystem parsing retain their existing owners; Core only coordinates them.

Safety and performance

  • Instruction discovery has bounded probes, file count, import depth, per-file size, and aggregate content limits.
  • Exact no-follow metadata checks reject symlinks and non-regular files before reads.
  • Remote SFTP caches are connection-generation scoped so stale sessions cannot publish into or invalidate a reconnected host.
  • Container and raw SFTP directory reads stop at the configured producer-side limit.
  • Missing files are treated as absent; permission, transport, and transient inspection failures remain visible and are not cached as empty context.

Validation

  • cargo check --workspace
  • cargo check -p bitfun-services-integrations --features remote-ssh-concrete
  • cargo test -p bitfun-agent-runtime-ipc (37 passed)
  • cargo test -p bitfun-cli --no-run
  • cargo test -p bitfun-cli --test product_assembly_cli (11 passed)
  • node --test scripts/check-core-boundaries.test.mjs (16 passed)
  • focused CLI Shared rename/help/status tests
  • focused remote SSH manager tests (21 passed, 1 ignored) and remote filesystem tests (3 passed)
  • Web type-check and reload command/API tests (64 passed)
  • i18n audit, repository hygiene, GitHub config checks, and git diff --check

Independent adversarial reviews found and verified fixes for unsupported-surface routing, no-follow/bounded remote reads, cache races, SFTP generation isolation, the rebased IPC version collision, Shared TUI capability copy, and CLI deployment adapter isolation. The final review reported no remaining P0-P2 findings.

@limityan
limityan force-pushed the yanzhn/unified-context-reload branch from 0dd1b82 to 43ad7fa Compare July 30, 2026 09:09
@limityan
limityan merged commit 29c2b15 into GCWing:main Jul 30, 2026
7 checks passed
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