Commit adbde39
authored
feat(upgrade): upgrade OpenHands from v1.6.0 to v1.7.0 (#81)
## Summary
Upgrade OpenHands from v1.6.0 → v1.7.0 (released 2026-05-01, 296 commits
since 1.6.0).
**v1.7.0 is a major V0→V1 cleanup release**, not a feature release.
Upstream deleted multiple V0 packages the fork was patching:
`openhands/llm/`, `openhands/utils/llm.py`, `openhands/storage/`,
`openhands/core/config/llm_config.py`, and stripped the store-class
fields from `openhands/server/config/server_config.py`. SDK bumped
v1.15.0 → v1.19.1 (4 minor versions).
## Status: DRAFT — `do-not-merge` label set
The infra-side wiring for v1.7.0 is committed in this PR. Two pieces of
dependent work in other repos must complete before this is mergeable:
1. **OpenHands fork branch `custom/v1.7.0-fargate`** must finish
cherry-picking the remaining 3 commits and add the new V1 Cognito ports
(`openhands/app_server/{settings,secrets,user_auth}/cognito_*.py`). Once
that lands and `FORK_REF` is bumped to its final SHA, also re-add those
3 file paths to `docker/download-fork-patches.sh:FILES` (they're
documented as TODO comments today).
2. **SDK fork branch** off v1.19.1 with the 5 Bedrock patches
(28/29/30/31/32) — currently those patches are applied in-place via
`apply-sdk-patches.py` against upstream
`OpenHands/software-agent-sdk@v1.19.1`. Optional follow-up: contribute
upstream and drop the patches in v1.8.x (see feasibility report §5).
Until those land, this PR's image build will succeed but the container
will fail-close at startup (Patch 21 multi-tenant verification refuses
to run when V1 Cognito injectors aren't wired in
`app_server/config.py`). That's the loud, intended failure mode.
## What's done in this PR
- [x] Feasibility report (`docs/designs/upgrade-v1.7.0-feasibility.md`)
— full plan with verified per-patch verdicts and risk register
- [x] `docker/Dockerfile`: `OPENHANDS_VERSION` 1.6.0 → 1.7.0;
`openhands-tools` 1.15.0 → 1.19.1; `FORK_REF` repointed to `b707ea5cc1`
(partial v1.7.0 fork checkpoint, 17/20 commits ported)
- [x] `docker/agent-server-custom/Dockerfile`: SDK clone pin v1.15.0 →
v1.19.1; VS Code stage `1.15.0-python` → `1.19.1-python`
- [x] `docker/agent-server-custom/apply-sdk-patches.py`:
- **Drop Patch 27** (max_output_tokens cap absorbed in SDK v1.19.1:
`llm.py:1273-1287` caps to half the context window when output ≥
context)
- **Re-anchor Patch 23** (insert before `@field_validator("skills")`
since `current_datetime` field was added between `secrets:` and the
validator in the v1.19.1 source)
- **Add Patch 28**: default credential chain in
`_list_bedrock_foundation_models` (allows IRSA / IAM-role /
`AWS_PROFILE` Bedrock listing without explicit static creds)
- **Add Patch 29**: cross-region inference profile listing (paginate
`list_inference_profiles(typeEquals=SYSTEM_DEFINED)`, surface
`bedrock/us.` / `bedrock/eu.` / `bedrock/apac.` / `bedrock/global.` IDs)
- **Add Patch 30**: cross-region prefix stripping in
`get_litellm_model_info` (so `bedrock/us.anthropic.claude-*` finds its
`model_cost` entry)
- **Add Patch 31**: `os.environ.setdefault("AWS_DEFAULT_REGION", …)`
alongside `AWS_REGION_NAME` in `_set_env_side_effects` (boto3 prefers
the former for some auth modes)
- **Add Patch 32**: env-hint trigger (`AWS_PROFILE` / `AWS_ROLE_ARN` /
`AWS_WEB_IDENTITY_TOKEN_FILE`) for Bedrock listing in
`get_supported_llm_models`
- [x] `docker/apply-startup.sh` Patch 21 rewrite —
**security-critical**. Was `grep s3_settings_store.S3SettingsStore` on
V0 file path; that file is gone in v1.7.0, so the `[ -f ]` guard would
silently skip the check. New check fail-closes on
`/app/openhands/app_server/config.py` not referencing
`CognitoS3SettingsStore` / `CognitoS3SecretsStore` / `CognitoUserAuth`.
Container refuses to start until V1 ports are wired.
- [x] `docker/download-fork-patches.sh` — drop V0-deleted entries
(server_config.py, secrets.py, llm/bedrock.py, llm/llm.py,
llm_config.py, utils/llm.py); add documented TODO for the 3 net-new V1
Cognito port files
- [x] `lib/compute-stack.ts`: `DEFAULT_OPENHANDS_VERSION` → 1.7.0;
`DEFAULT_RUNTIME_VERSION` → 1.7-nikolaik; image-digest TODO marker (will
be updated after first `docker pull` of v1.7.0 base image)
- [x] Snapshot regen: `test/__snapshots__/stacks.test.ts.snap`
- [x] PR review (`code-reviewer` agent) — both findings addressed: VS
Code stage tag mismatch fixed, `FORK_REF` blocking-merge concern →
`do-not-merge` label
- [x] Local build passes: `npm run build`
- [x] Local unit tests: 122 passed, 7 pre-existing failures
(`UserConfigStack` `PythonFunction` ARM64 Docker bundling — known
QEMU/binfmt issue on this dev box, called out in feasibility §A-3)
## Done in earlier sessions of this PR
- Feasibility report committed
- Fork branch `custom/v1.7.0-fargate` pushed at SHA `b707ea5cc1` on
`zxkane/OpenHands` (17/20 v1.6.0 fork commits cherry-picked; 3
LLM-targeting commits intentionally skipped because they target V0 files
now deleted upstream — those move to SDK-side patches instead)
## TODO before this PR is mergeable
- [ ] **Finish fork branch** `custom/v1.7.0-fargate` (3 remaining
cherry-picks + 3 new V1 Cognito port files); update `FORK_REF` and
re-add the 3 paths to `download-fork-patches.sh:FILES`
- [ ] **SDK fork branch** off v1.19.1 with the 5 Bedrock patches
(alternative: keep applying via `apply-sdk-patches.py` against upstream;
the patches are stable as long as the SDK source doesn't shift)
- [ ] **Pull v1.7.0 base image** and update `OPENHANDS_IMAGE_DIGEST` in
`lib/compute-stack.ts` + `docker/Dockerfile` (placeholder is the v1.6.0
digest — will fail loudly during Docker build until updated)
- [ ] **Staging deploy** (`./deploy-staging.local.sh`) — requires QEMU
binfmt for ARM64
- [ ] **E2E tests** (`./test/select-e2e-tests.sh --all`) — major upgrade
- [ ] **Bedrock-with-IAM-role smoke test** — verifies SDK Bedrock
patches (28-32) work end-to-end
- [ ] Multi-tenant isolation E2E (two users, settings/secrets confined
to `users/{user_id}/...` paths)
## Test Plan
- [x] Build passes: `npm run build`
- [x] Unit tests pass (122/129; 7 pre-existing ARM64 Docker bundling
failures unrelated to v1.7.0)
- [ ] Multi-tenant isolation E2E: two users, settings/secrets confined
to `users/{user_id}/...` paths
- [ ] Conversation lifecycle E2E: start, pause, resume, archive
- [ ] Bedrock E2E: IAM-role-only profile (no static keys) lists models
and runs a conversation
## Design
- [x] Feasibility report (`docs/designs/upgrade-v1.7.0-feasibility.md`)
with verified per-patch verdicts and risk register
## Linked
- Fork branch (partial):
https://github.com/zxkane/OpenHands/tree/custom/v1.7.0-fargate
- Upstream v1.7.0 release:
https://github.com/OpenHands/OpenHands/releases/tag/1.7.01 parent 7f58ab5 commit adbde39
18 files changed
Lines changed: 1322 additions & 722 deletions
File tree
- docker
- agent-server-custom
- docs/designs
- lambda/conversation-delete
- lib
- test
- __snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
30 | | - | |
31 | | - | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 58 | + | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
59 | | - | |
60 | | - | |
| 66 | + | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | | - | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | | - | |
29 | | - | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
194 | 198 | | |
195 | 199 | | |
196 | 200 | | |
197 | | - | |
198 | | - | |
| 201 | + | |
| 202 | + | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
| |||
0 commit comments