microsoft / microsoft/amplifier
Session-scoped settings.yaml provider overrides silently ignored on `amplifier resume` (amplifier-app-cli)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.1k
- Forks
- 261
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 13
Description
Summary
Bug: amplifier resume <session_id> silently ignores session-scoped settings.yaml provider overrides, making them non-functional for workload recovery.
Impact: Users cannot use session-scoped config overrides (e.g., enable_response_chaining: false) to recover from issues like #321 (response-chaining context overflow). The workaround suggested in #321 does not work due to this defect.
Root cause: Resume code path builds an un-scoped AppSettings() instead of AppSettings().with_session(session_id, project_slug), so session-scoped settings files are never loaded.
Verified Evidence
Location of defect: amplifier-app-cli
This defect is in the CLI reference implementation, not amplifier-core. However, since microsoft/amplifier-app-cli has issues disabled and is marked as a reference implementation not accepting external contributions, this issue is filed in amplifier-core for visibility and tracking.
Code evidence
File: amplifier-app-cli/amplifier_app_cli/commands/session.py
-
Line 131 — Unscoped AppSettings() built at resume choke point:
app_settings = AppSettings() # WRONG — should use .with_session()This occurs in
_prepare_resume_context(), which is the single choke point all four resume code paths funnel through (interactive_resume, spawn_session_from_saved, etc.). -
Line 139 —
project_slugcomputed AFTER settings are built:project_slug = ... # computed here, AFTER line 131This means the fix requires reordering: compute
project_slugfirst, then callAppSettings().with_session(session_id, project_slug).
Why session-scoped settings are silently skipped
File: amplifier-app-cli/amplifier_app_cli/lib/settings.py
-
Line 112-115 —
.with_session()correctly rebuilds scoped paths:def with_session(self, session_id, project_slug): return AppSettings(paths=self.paths.with_session(session_id, project_slug)) -
Line 357 —
.get_provider_overrides()reads fromself.paths.session_settings:
On a plainAppSettings(),self.pathsis built without session context, soself.paths.session_settingsisNone. -
Line 376-387 —
.get_merged_settings()silently fails on missing paths:except: pass # Silent failure when self.paths.session_settings is NoneNo error is logged; the session-scoped override is simply omitted.
Inconsistent pattern found
File: amplifier-app-cli/amplifier_app_cli/lib/settings.py, lines 1031-1066
The codebase already has the correct pattern for tool overrides:
def get_tool_overrides(self, session_id=..., project_slug=...):
# CORRECTLY uses session_id and project_slug to construct scoped path
This proves the pattern works but was only applied to tool overrides, not to provider overrides in the resume path.
Impact on session 507f3164-6b1e-48ff-a8ce-766e5cdbde76
- User attempted to recover from #321 (response-chaining overflow) using session-scoped
settings.yamlwithenable_response_chaining: false - Offline check using
.with_session()directly confirmed the override would resolve toFalse - Live
amplifier resumeimmediately failed with identical error because the setting was never loaded - This proved the override mechanism itself (file creation, storage path) works, but the resume code path doesn't read it
Suggested Fix
In amplifier-app-cli/amplifier_app_cli/commands/session.py, _prepare_resume_context():
- Reorder to compute
project_slugbefore buildingapp_settings - Change line 131 from:
to:app_settings = AppSettings()app_settings = AppSettings().with_session(session_id, project_slug)
This closes the gap where only get_tool_overrides() was session-aware, but get_provider_overrides() was not.
Testing
Add a regression test asserting that:
- A session with a session-scoped
settings.yamloverride (e.g.,enable_response_chaining: false) is created amplifier resume <session_id>loads the override (verify viasession:configdiagnostic event or CLI output)- The override value flows to the actual mounted provider instance
- Verify this works for multiple provider override types (not just
enable_response_chaining)
Related
- microsoft/amplifier#321 — Response chaining context overflow; suggests session-scoped override as workaround, but that workaround is currently non-functional due to this defect
- microsoft/amplifier-app-cli#233 — Provider mismatch guard and session repair (related infrastructure work)
Notes for maintainers
- The defect is low-severity operationally (requires explicit session-scoped settings.yaml to trigger) but high-severity for recovery workflows (blocks the #321 workaround)
- This is a reference implementation issue, not a core Amplifier kernel issue
- microsoft/amplifier-app-cli has issues disabled; this issue tracks the defect for visibility
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with amplifier_app_cli/commands/session.py and inspect _prepare_resume_context(), then compare its AppSettings construction with amplifier_app_cli/lib/settings.py, especially with_session(), get_provider_overrides(), and get_merged_settings(). Confirm the session-scoped provider override is loaded during resume and add regression coverage for the reported override flow; note that the defect is in the external amplifier-app-cli reference implementation, whose issues are disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100