Repository navigation
feat(life/app): app-only prompt slimming + per-agent appSkills scoping - #80
Merged
Merged
Conversation
… scoping Reduce per-turn latency + tokens for Havaya app-user sessions while keeping Telegram/owner prompts byte-identical (all changes flow through app-only code paths): - New "app" PromptMode: drops CLI quick-ref / self-update / model-aliases / docs / silent-replies / heartbeats / owner-identity (privacy) but KEEPS Reply-Tags/ Messaging/Voice (unlike "minimal"). Telegram/owner stay on "full". - App-only bootstrap shaping (resolveBootstrapFilesForRun → applyAppBootstrapVariants): excludes boilerplate (TOOLS/MEMORY/HEARTBEAT/IDENTITY/USER) and prefers lean <name>.app.md variants when present (AGENTS.app.md/SOUL.app.md). Originals untouched. - Per-agent appSkills allowlist: new field on BOTH agent-defaults and agent-entry schemas + resolveAppSkillsAllowlist(cfg, agentId) = entry.appSkills ?? agents.defaults.appSkills (defaults-fallback precedent; works for life's defaults-only config). limitAppSkills takes the caller-resolved allowlist → never global. - Shared resolveAppPromptContext helper consumed by BOTH attempt.ts and compact.ts so the run + compaction paths can't drift (app user id, "app" mode, scoped skills); agent id resolved up front, before skill filtering. Implements PR #77 plan (rev4). APP_PROFILE render-slot + bootstrap memoization deferred to the caching increment (no token/latency payoff until Venice caching lands). Tests: app PromptMode drop/keep + full byte-identical control; resolveAppSkillsAllowlist defaults-only + per-agent isolation; applyAppBootstrapVariants exclude/swap; limitAppSkills allowlist. tsgo + oxlint clean. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jun 20, 2026
cryptolir
added a commit
that referenced
this pull request
Jun 20, 2026
… full canonical) (#84) Codex post-merge review of #83 (4537421648): the prior fix warned but still fell through to result.push(file), so an app session still received the FULL AGENTS.md/SOUL.md on a bad-variant turn — preserving the #82 privacy/slimming regression. Now a non-ENOENT/ENOTDIR variant read failure DROPS the file for that app session (fail-closed) instead of serving the canonical full file; warning still surfaces the broken deploy. ENOENT/ENOTDIR (genuinely absent) still falls back to canonical (correct for files with no variant). EISDIR test now asserts FULL AGENTS never enters the returned files. Also fixes a latent tsgo error in the #80 system-prompt.app-mode.test.ts (readonly as-const ownerNumbers). Co-authored-by: Liran Peretz <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the Phase 1–2 token/latency optimization from #77 (rev4), scoped to app-user sessions only — Telegram/owner prompts stay byte-identical (all changes flow through app-only code paths).
What changed
system-prompt.ts): drops CLI quick-ref / self-update / model-aliases / docs / silent-replies / heartbeats / owner-identity (privacy), but keeps Reply-Tags/Messaging/Voice (unlike"minimal"). Telegram/owner stay on"full".resolveBootstrapFilesForRun→applyAppBootstrapVariants): excludes boilerplate (TOOLS/MEMORY/HEARTBEAT/IDENTITY/USER) and prefers lean<name>.app.mdvariants when present (AGENTS.app.md/SOUL.app.md). Originals never read for swapping → non-app byte-identical.resolveAppSkillsAllowlist(cfg, agentId) = entry.appSkills ?? agents.defaults.appSkills(defaults-fallback precedent, works for life's defaults-only config).limitAppSkillstakes the caller-resolved allowlist → never global.attempt.tsandcompact.tsso the run + compaction paths can't drift; agent id resolved up front, before skill filtering.Deferred (to the caching increment)
APP_PROFILE dedicated render-slot + per-session bootstrap memoization — pure cache-prefix-stability work with no token/latency payoff until Venice caching lands (Phase 3). APP_PROFILE stays exactly where it is, so the #71 first-turn greeting is untouched.
Verification
tsgo+oxlintclean. New tests (22): app PromptMode drop/keep + full byte-identical control;resolveAppSkillsAllowlistdefaults-only + per-agent isolation;applyAppBootstrapVariantsexclude/swap;limitAppSkillsallowlist.🤖 Generated with Claude Code