匠人学院 JR Academy
  • Position

    Where am I now, and where should I go?

    How your job is changing, where your experience can take you and what you still need for a target role, worked out from what you have actually done. Free, and the full result needs no sign-up.

    Analyse my career and skills

    Look up a career

    Will AI replace my job?AI impact and transition paths for common careersNew jobs in the AI eraWhat they do, what they need, how to move in

    Focused tools

    AI Engineer interview readiness30 timed questions on what you still need before interviewsCareer personality testDirections that suit how you workReturning to China checkJob prospects in China by school, major and graduation date

    AI coach

    Talk to your AI coachStill unsure after your result? Talk through what is holding you back
  • Core courses

    AI Engineer BootcampEngineering bootcamp from LLM apps to agentsAI Engineer Full-Stack Project Class16 weeks · RAG and full-stack AI projectsVibe Coding Masterclass8 weeks · direct agents to build and ship a productAI Essentials10 hours · use AI for email, reports, data and copyAI Office Automation Course8 weeks · help a whole company adopt AIOne-Person Company (OPC) Bootcamp15 weeks in person · build a one-person company with AIAll courses →

    AI engineering

    Machine Learning & Data Engineering Full-Stack ClassAI Agent & MCP Project BootcampAI Engineer Core TechniquesAI Engineer FoundationsAI Engineer Advanced: RAG to Agents and TuningClaude Code TasterAll AI engineering courses →

    AI at work

    AI Coding for everyoneClaude Code One-Day Masterclass (Non-Technical)Enterprise AI Automation BootcampAI Marketing BootcampAI Risk, Governance and Audit CourseOpenClaw 4-Week Personal AI Assistant BootcampAll AI-at-work courses →

    Career development

    AI Product Manager (BA) Bootcamp + InternshipAustralia IT Interview BootcampAustralia IT Technical Interview BootcampAustralia IT Resume BootcampAustralia Big Tech Job Search BootcampAustralia IT Career Planning BootcampAll career courses →

    Learn free first

    Vibe CodingAI for office workPrompt MasterAI EngineerAI data analysisResource centerInstructorsAll learning paths →
  • Evidence

    What will convince an employer?

    Certifications, projects, team work and competition entries, collected into one portfolio.

    See the portfolio

    Certifications

    Cert Master · all certificationsPrep and mock exams for AWS, Azure, GCP, Claude and moreAWS CLF-C02Entry-level AWS cloud certificationAWS SAA-C03Entry certification for cloud architectsClaude certificationsAnthropic Claude certification seriesAll certifications →

    Projects and team work

    P3 team projectsBuild a project with real teammates in a simulated team workflowP3 project experienceThe parts of a P3 project that go on your resumeDemo DayProject showcaseP3 certificatesProof once a project is completeAll of P3 →

    Competitions and work

    HackathonsBuild something against the clockSubmit your workAdd your project to the showcaseCareerOS portfolioDo tasks in the desktop app; your results become portfolio pieces
    Cert MasterBrowser extension, app and mini programScreenshot a question for analysis and practise anywhereAbout Cert Master
  • Connect

    How do I get myself in front of employers?

    Resume, interviews, referrals and mentors. See how far you are from the target role first, then decide what to fix.

    Start with Jobpin

    Resume and openings

    Graduate careersGraduate preparation across Australia, China, Malaysia, Singapore, the US and UKJobpinAI job search workspace: resume, roles, applicationsAI resumeRewrite your resume against a job descriptionReferralsRoles shared by students and mentorsOpportunitiesInternships, projects and collaborationsOffer boardOffers students have received

    Interviews

    AI Engineer interview guideSeven areas, with worked examplesFDE interview guideFive rounds, from scoping to the customer roundAI mock interviewPractise by text or voice and see the gapsInterview storiesReal interview experiencesSystem Design handbookPrepare for system design interviewsAll interview prep →

    Mentors

    1:1 mentorsBook AI, career and technical mentors by the hourGroup tutoringShare a tutor with a few others and pay less eachCareer coachingResume, interview and direction packages
    Jobpin desktopOne workspace for the whole job searchOrganise real experience and refine resume versions for target roles on macOS or Windows.About Jobpin
BusinessMembershipDownload CareerOS
0
匠人学院 JR Academy

Follow Us

linkedinfacebooktwitterinstagramyoutube

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png
Airbotix · AI learning & creation for kids Another Life · AI story game
Products46

CareerOS and tools

  • CareerOS
  • Cert Master
  • Jobpin
  • Jobpin web
  • Jobpin report
  • Jobpin desktop download
  • My job search reports
  • Buy report credits
  • Jobpin billing
  • AI Toolbox
  • AI Skill Marketplace

Membership

  • Membership
  • AI membership

Courses

  • Bootcamps
  • Training Camp
  • Kanban learning
  • AI Builder course
  • MCP course
  • NotebookLM workshop
  • Business Analyst course
  • Web Full-Stack Bootcamp
  • DevOps Bootcamp
  • Data Engineering Bootcamp
  • Data Analysis Bootcamp
  • Coding for Beginners
  • Algorithm Bootcamp

Career services

  • Graduate careers
  • Graduate careers in Australia
  • Graduate careers in China
  • Graduate careers in Malaysia
  • Graduate careers in Singapore
  • Graduate careers in the US
  • Graduate careers in the UK
  • 1:1 coaching
  • Career coaching
  • AI Engineer VIP
  • BA & PM Internship
  • Data Science Internship
  • Data Analysis Internship
  • Marketing Internship
  • Resume Review
  • Interview Coaching
  • Job Application Service
  • Job Monitoring
  • LinkedIn Management
  • LinkedIn Networking
Library57

Learning paths

  • All Learning Paths
  • AI Engineer
  • Context Engineering
  • Vibe Coding
  • Prompt Master
  • AI Builder
  • AI Product Manager
  • Python Basics
  • AI Productivity
  • AI Data Analysis
  • AI Finance
  • AI Content Creation
  • AI Image Creation
  • Frontend Development
  • Hermes Agent
  • OpenClaw Local Agent

Interactive labs

  • Prompt Lab
  • Frontend Lab
  • JavaScript Lab
  • Python Lab
  • AWS Lab
  • Azure Lab
  • LLM Lab
  • Git Lab

Reference and guides

  • Resources
  • Wiki
  • Cheat sheets
  • Roadmaps
  • AI roadmaps
  • Videos
  • Ebooks
  • Blog
  • Interview handbook
  • Mock exams
  • Free resources

Cities

  • Sydney
  • Melbourne
  • Brisbane
  • Adelaide
  • Singapore
  • Kuala Lumpur
  • London
  • New York
  • San Francisco
  • Los Angeles
  • Seattle
  • Toronto
  • Vancouver

Immigration

  • Australia Immigration
  • Skilled Visa 189/190/491
  • Employer Sponsored 482/186/494
  • Business Visa 188/888
  • UK Immigration
  • US Immigration
  • Canada Immigration
  • Singapore immigration
  • Malaysia immigration
Business20

For business

  • AI for Business
  • Business portal sign-in
  • Corporate Training
  • Internship Partnership
  • Recruitment Partnership
  • Enterprise (EN)

Metatree AI Lab

  • Metatree AI Lab (Chinese)
  • AI solutions (Chinese)
  • Digital employees (Chinese)
  • Case studies (Chinese)
  • Metatree AI Lab
  • AI services
  • Digital employees
  • Case studies

AI education for kids

  • Airbotix — AI Learning & Creation for Kids
  • AU Family Resource Hub
  • NAPLAN Report Guide
  • My School Data Guide
  • Sydney Private School Fees 2026
  • Kids Coding Programs
About15

Company

  • About Us
  • Our Mentors
  • Become a Mentor
  • Metaverse Classroom
  • JR Careers
  • Another Life — AI Story Game
  • Contact Us

Help and policies

  • FAQs
  • Terms & Conditions
  • Privacy Policy
  • Cancellation & Refund Policy
  • Site map

Friend links

  • CS Browser

Contact

  • hello@jiangren.com.au
  • 0421-672-555

Offices

Level 10b, 144 Edward Street, Brisbane CBD (Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
45A13, Block B, Oriental Hope Tianxiang Plaza, 500 Tianfu Avenue Middle Section, Wuhou District, Chengdu, Sichuan, China
Business Hub, 155 Waymouth St, Adelaide SA 5000
Disclaimer
footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

All content on the JR Academy website, including course materials, logos, and information provided, is protected under Australian intellectual property laws. Unauthorized use, sale, distribution, reproduction, or modification is strictly prohibited. Violations may result in legal action. By accessing our website, you agree to respect our intellectual property. JR Academy Pty Ltd reserves all rights, including patents, trademarks, and copyrights. Any infringement will be subject to legal prosecution. View Terms of Service

© 2017-2026 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572

HomeLearnCoursesCerts
  1. Home
  2. Learn
  3. Blog
  4. OpenHands 实战指南:开源 AI 编程 Agent — 进阶玩法:多模型、CI 集成与团队协作
JR Academy · BlogCareer insights

OpenHands 实战指南:开源 AI 编程 Agent — 进阶玩法:多模型、CI 集成与团队协作

接入本地模型(Ollama)、config.toml 高级配置、Headless 模式集成 CI/CD、MicroAgent 扩展、安全最佳实践

Published2026-12-01
Reading time2 min
Author

Contents

  • 多模型配置:省钱又灵活
  • 接入本地模型(Ollama)
  • Headless 模式:集成到 CI/CD
  • MicroAgent 和扩展生态
  • 安全最佳实践
  • 确认模式
  • Docker 隔离要点
  • Token 预算控制
  • 团队协作模式(Cloud)

多模型配置:省钱又灵活

OpenHands 通过 LiteLLM 支持几乎所有 LLM 提供商。核心思路:主任务用强模型,子任务用便宜模型。

# config.toml — 多模型配置示例
[llm]
model = "anthropic/claude-sonnet-4-20250514"
api_key = "sk-ant-xxx"
temperature = 0.0

[llm.cheap]
model = "openai/gpt-4o-mini"
api_key = "sk-xxx"

[llm.local]
model = "openai/qwen3-coder:30b"
api_key = "dummy"
base_url = "http://host.docker.internal:11434/v1"

# 指定不同 Agent 用不同模型
[agent.RepoExplorerAgent]
llm_config = "cheap"

这样主 Agent 用 Claude Sonnet 做复杂推理,代码搜索子任务用 GPT-4o-mini 省钱。

接入本地模型(Ollama)

不想付 API 费用?本地跑也行:

# 1. 启动 Ollama,设置足够大的上下文窗口
OLLAMA_CONTEXT_LENGTH=32768 OLLAMA_HOST=0.0.0.0:11434 ollama serve

# 2. 拉模型(推荐 Qwen3-Coder 或 Devstral)
ollama pull qwen3-coder:30b

# 3. config.toml 配置
# model = "openai/qwen3-coder:30b"
# base_url = "http://host.docker.internal:11434/v1"
# api_key = "dummy"

⚠️ 踩坑点:Ollama 默认 context 只有 4096 token,OpenHands 需要至少 32K。不设 OLLAMA_CONTEXT_LENGTH 会导致各种诡异报错。

OpenHands 代码修改视图

Headless 模式:集成到 CI/CD

这是 OpenHands 区别于所有 IDE 工具的杀手级功能——它能在无人值守的环境里跑。

# 在 CI 管道里自动执行任务
openhands --headless -t "分析最近 3 个 commit 的代码质量,输出报告"

# JSON 输出,方便解析
openhands --headless --json -t "检查是否有安全漏洞" > report.json

# 设置预算上限(CI 里必须加)
openhands --headless --max-iterations 30 -t "修复 lint 错误"

实战案例——自动修 lint 的 GitHub Action:

name: Auto-fix Lint
on:
  push:
    branches: [main]

jobs:
  lint-fix:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run OpenHands to fix lint
        run: |
          pip install openhands-ai
          openhands --headless --always-approve \
            --max-iterations 20 \
            -t "运行 eslint,修复所有 auto-fixable 问题,提交修改"
        env:
          LLM_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          LLM_MODEL: anthropic/claude-sonnet-4-20250514

MicroAgent 和扩展生态

OpenHands 有一个扩展仓库(github.com/OpenHands/extensions),包含 38 个 Skills 和 9 个 Plugins:

常用 Skills:

  • code-review — 自动代码审查
  • docker — Docker 容器管理
  • kubernetes — K8s 操作
  • security — 安全扫描
  • release-notes — 自动生成发版说明
  • frontend-design — 前端设计建议

自定义 MicroAgent:

在项目根目录创建 .openhands_instructions 文件,给 Agent 定制指令:

# 项目规范

- 使用 TypeScript strict 模式
- 所有函数必须有 JSDoc 注释
- 测试覆盖率不得低于 80%
- commit message 遵循 Conventional Commits
- 不使用 any 类型

Agent 每次启动都会读这个文件,按照你的规范行事。

安全最佳实践

确认模式

[security]
confirmation_mode = true     # 每步操作都要你确认
# 或
security_analyzer = "llm"    # 用 LLM 判断操作是否安全

三档选择:

  • 确认模式:每步手动批准(最安全,适合新手)
  • LLM 审查:自动用另一个 LLM 判断操作安全性(推荐)
  • 全自动:--always-approve(仅在你完全信任场景时使用)

Docker 隔离要点

# ✅ 只挂载项目目录
-e SANDBOX_VOLUMES="/home/user/project:/workspace:rw"

# ❌ 永远不要挂载这些
# /home/user/.ssh
# /home/user/.aws
# /etc/passwd
# /var/run/docker.sock(除非是 Docker-in-Docker 场景)

Token 预算控制

CI 环境里必须设置硬上限:

[core]
max_iterations = 50          # 最多 50 步

[llm]
num_retries = 3              # API 重试上限
retry_min_wait = 5           # 重试间隔(秒)
retry_max_wait = 60

没有上限的 Agent 在遇到解不了的问题时会反复尝试,一晚上能烧掉几十美元 API 费。

团队协作模式(Cloud)

OpenHands Cloud 的 Team 版本支持:

  • 多用户共享项目
  • RBAC 权限控制
  • 集中计费和用量报表
  • Slack 集成——在 Slack 里 @Agent 就能触发任务
  • Jira/Linear 集成——Issue 自动同步

对于 5 人以上的团队,Cloud Team($500/月)比每人各自配置 API Key 更划算,也更可控。

Author
Share or copy the link
← Previous articleOpenHands 实战指南:开源 AI 编程 Agent — 核心功能深度解析Next article →OpenHands 实战指南:开源 AI 编程 Agent — 常见问题、定价与选型建议

Related articles

USYD 医疗初创盘点、网络平台注意义务法案、全身 MRI 广告研究

2026-12-02

UQ 皮肤癌在线硕士开办 20 周年、中澳绿色钢铁对话、HIV 预防提醒

2026-12-02

UNSW iFire 2.3 火场模拟系统、AI 卵巢癌预后研究、艺术家与 AI 版权调查

2026-12-02

ANS-C01 退役倒计时 29 天 · AIB-C01 Beta $50 新认证上线 · MLA-C02 Beta 报名开放

2026-12-02

Amazon开放首个自研大模型Ergo,代理作弊率实测差距悬殊,Anthropic格密码结果暂无现实威胁

2026-12-02

GitHub Copilot 实战指南 — Copilot AI Code Review:30 秒让 AI 帮你审 PR,三档深度随需切换

2026-12-01
View all articles →

Done reading? Next steps

Not sure what to learn next? Tell us where you are

Tell us what you do now and where you want to go. See your gaps in skills, evidence, experience, expression and positioning, and what to work on first. No sign-in needed.

Compare with my situation
  • SkillAI Engineer Bootcamp13 weeks, 12 Theory + 13 Practice live classes. You build one Agent system across Context, RAG, Tools, Memory and production Evals. Built for Applied AI and Agent Engineer roles.See the program →
  • PositioningLearning roadmaps by roleFrontend, backend, data, AI and more, laid out stage by stage in the order to learn them.All roadmaps →
  • ExpressionTry an AI mock interviewPick a role and run a mock interview to practise explaining your experience and projects.Practise now →

Not sure what to do next?

Take this page's topic with you and see where your gaps are.

Compare with my situation
JR Academy
AI learning for the global Chinese community
BootcampsFree resourcesLearn AICareer coaching
精选推荐
AI Career Impact Map
Assess career exposure and explore transition paths and learning options
Popular tool
AI & Data Bootcamps
Build your skills through structured courses and hands-on projects
Popular courses
1:1 Career Coaching
Work with an experienced mentor on your resume and interview preparation
Career coaching
Custom Corporate Training
AI training tailored to your team
Business services
Popular tags
Vibe CodingAI codingCursorClaudeJob searchPromptFrontend developmentBackend development
Subscribe to updates

Receive AI learning resources, technical tutorials and career advice by email.

We respect your privacy and do not send spam.