匠人学院 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 — Automations 与成本追踪:让 Agent 定期自动跑
JR Academy · BlogCareer insights

OpenHands 实战指南:开源 AI 编程 Agent — Automations 与成本追踪:让 Agent 定期自动跑

OpenHands Automations:定时(cron)+ 事件驱动(webhook)自动触发 Agent,Activity Log 查看每次对话的真实 LLM 费用

Published2026-12-01
Reading time2 min
Author

Contents

  • 从"用的时候才开"到"自动跑"
  • 创建定时自动化(Cron 触发)
  • 事件驱动触发(Webhook)
  • Activity Log:每次跑了多少钱,一目了然
  • 成本控制:按任务等级选模型
  • Activity Log 异常排查
  • Automations 的适用场景与局限

从"用的时候才开"到"自动跑"

OpenHands 默认是交互式工具——你打开浏览器,输任务,等结果。但很多场景不需要人在旁边:

  • 每天早上扫描新 Issue,自动打标签分类
  • 每次 PR 被 Review 后,检查是否有漏写测试
  • 每周一生成代码健康度报告
  • 每晚对暂存代码跑安全扫描

这就是 Automations 的用途:把一次性任务变成定期运行的工作流,你不在电脑旁也能跑。

创建定时自动化(Cron 触发)

在 OpenHands Cloud(app.openhands.dev),进入 Automations → New Automation。

示例:每天早上自动整理新 Issue

名称:Daily Issue Triage
触发:定时(Cron)
Cron 表达式:0 9 * * 1-5      # 工作日 09:00 UTC
任务描述:
  扫描这个 GitHub repo 里所有 state=open 且没有 label 的 Issue,
  根据标题和描述内容给每个 Issue 打上对应标签:
  - bug:描述中有报错信息或"不正常""失败""报错"
  - feature:描述中有"希望""支持""增加"等
  - docs:涉及文档、注释、说明
  只打标签,不关闭 Issue,不回复评论。
  
模型:claude-haiku-4-5        # 例行任务用便宜模型
Max iterations:30

保存后,Automations 面板会显示下次触发时间和历史运行记录。

事件驱动触发(Webhook)

除定时外,还可以响应 GitHub 事件。进入 Automation 设置 → Trigger → Webhook,复制生成的 Webhook URL,然后在 GitHub 仓库的 Settings → Webhooks 里注册:

Payload URL:https://api.openhands.dev/webhooks/automation/{your-id}
Content type:application/json
触发事件:Pull requests(选 review_requested)

示例:PR Review 请求后自动检查测试覆盖

触发:Webhook(PR review_requested 事件)
任务描述:
  检查这个 PR 的 diff 里改动的函数,确认每个改动的函数
  都有对应的单元测试。
  
  如果发现有函数改动但没有对应测试更新,
  在 PR 评论里列出缺少测试的函数名(格式:文件名:函数名),
  并说明测试应该覆盖的场景。
  
  如果所有改动都有对应测试,不需要发评论。
  
模型:claude-sonnet-4         # 代码审查需要更强的推理
Max iterations:20

这个 Automation 每次有人发起 Review 请求时自动触发,不需要人工运行。

Activity Log:每次跑了多少钱,一目了然

**v1.11(2026 年 8 月)**加了一个长期缺失的功能:Activity Log 里直接显示每次对话的 LLM 费用。

进入 Activity Log 页面,每行记录包含:

日期时间          | 任务名               | 状态 | 模型              | Token用量 | 费用
2026-08-13 09:00 | Daily Issue Triage   | ✅   | claude-haiku-4-5  | 42K       | $0.04
2026-08-12 09:01 | Daily Issue Triage   | ✅   | claude-haiku-4-5  | 38K       | $0.04
2026-08-11 15:30 | 手动任务             | ✅   | claude-sonnet-4   | 156K      | $0.62
2026-08-11 14:02 | PR Review Checker    | ❌超时| claude-sonnet-4  | 89K       | $0.36

右上角点 Export CSV 可以导出,放进 Excel 做月度成本分析。

成本控制:按任务等级选模型

最有效的省钱策略:不同任务用不同等级的模型。

# config.toml — 多模型配置
[llm]
# 主任务:复杂推理、代码架构分析
model = "anthropic/claude-sonnet-4-20250514"
api_key = "sk-ant-xxx"

[llm.routine]
# 例行任务:Issue 分类、格式检查、文档生成
model = "anthropic/claude-haiku-4-5-20251001"
api_key = "sk-ant-xxx"

[llm.local]
# 敏感代码:本地运行,API 费用为零
model = "openai/qwen3-coder:30b"
api_key = "dummy"
base_url = "http://host.docker.internal:11434/v1"

参考成本估算:

使用场景 推荐模型 每次任务 月成本估算
复杂功能开发(每天 5 次) Sonnet 4 $0.30-0.80 $45-120
Issue 分类自动化(每天 1 次) Haiku 4.5 $0.03-0.08 $1-3
PR 测试检查(每天 10 次 PR) Haiku 4.5 $0.05-0.15 $15-45
本地模型(全部) Qwen3-Coder 30B $0 只算电费

Activity Log 异常排查

Activity Log 里找 token 用量异常高的记录(单次超过 200K token),通常来自以下原因:

原因 1:任务描述太模糊,Agent 反复尝试

# 差:
openhands -t "修一下那个 bug"

# 好:
openhands -t "修复 src/auth.ts 第 42 行的空指针异常,
复现步骤:调用 login() 时 user 对象没有 email 字段时抛错。
修复方案:加 optional chaining,user?.email"

原因 2:没有设置迭代上限

# config.toml — 必加,尤其是 Automation 场景
[core]
max_iterations = 50      # 50 步还没搞定,就停下来

[condenser]
type = "llm"
max_size = 80            # 超过 80 条事件,用便宜模型压缩历史

原因 3:大文件被完整塞进上下文

OpenHands 读大文件(>1000 行)时会全量传入上下文。如果你的项目有超大文件,在任务描述里明确告诉它只看哪些部分:

只看 src/api/routes.ts 里 /auth/* 相关的路由,不用读整个文件

Automations 的适用场景与局限

最适合自动化的任务:

  • 有明确判断标准的检查(测试覆盖、lint 错误、依赖更新)
  • 格式化和分类工作(Issue 标签、PR 描述补全)
  • 定期报告生成(代码统计、dependency audit)
  • 重复性的、规则清晰的代码改动(批量 API 版本升级)

不适合自动化的任务:

  • 需要理解业务背景的功能开发(Agent 没有你的产品知识)
  • 涉及多团队协调的改动
  • 任何会直接 merge 到 main 的操作(Automation 产出应该是 Draft PR,人工 Review 后再 merge)

一个安全原则:Automation 只产 PR,不 merge。 让 Agent 负责"写建议",人负责"做决策"。

Author
Share or copy the link
← Previous articleOpenHands 实战指南:开源 AI 编程 Agent — Planning Mode 实战:先规划,再执行Next article →Kiro AI IDE 实战指南 — Kiro 是什么:AWS 的规格驱动 AI IDE

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.