<PAGE>

                                                                    EXHIBIT 10.4

                          FORM OF EMPLOYMENT AGREEMENT

     This sets forth the terms of the Employment Agreement between (i) COMMUNITY
BANK SYSTEM, INC., a Delaware corporation and registered bank holding company,
and COMMUNITY BANK, N.A., a national banking association, both having offices
located in Dewitt, New York (collectively, the "Employer"), and (ii) JAMES M.
O'BRIEN, an individual currently residing at Dallas, Pennsylvania ("Employee").
This Agreement shall become effective upon the closing of the merger of
Community Bank, N.A. and First Heritage Bank ("Merger").

                               W I T N E S S E T H

     IN CONSIDERATION of the promises and mutual agreements and covenants
contained herein, and other good and valuable consideration, the parties agree
as follows:

     1. Employment.

          (a) Term. Employer shall employ Employee, and Employee shall serve, on
a part-time basis as Consultant for Community Bank System, Inc. and Community
Bank, N.A. for the period that begins on the date of the closing of the Merger
and that ends on the third anniversary of the closing date of the Merger
("Period of Employment"), subject to termination as provided in paragraph 3
hereof.

          (b) Salary. From the effective date of this Agreement through the
first anniversary of the closingdate of the Merger, Employer shall pay Employee
base salary at the


<PAGE>

annual rate of $160,000 ("Base Salary"). Thereafter, Employer shall pay Employee
Base Salary at an annual rate of $50,000. Base Salary shall be payable in
accordance with Employer's regular payroll practices for executive employees.

     2. Duties during the Period of Employment.

          (a) Employee shall be designated as a Consultant to Employer and shall
have such responsibility, subject to the control of the authorized designee of
Employer's Board of Directors, for the discharge of such consulting and other
duties and responsibilities to Employer as may from time to time be reasonably
assigned to Employee by the authorized designee of Employer's Board of
Directors. Employee shall report to Employer's President, Pennsylvania Banking.

          (b) During the first twelve months of the Period of Employment,
Employee shall not be required to provide more than 500 hours of consulting
services pursuant to this Agreement. During each of the two remaining
twelve-month periods of the Period of Employment, Employee shall not be required
to provide more than 250 hours of consulting services pursuant to this
Agreement. Employee shall provide the consulting services at such times and at
such locations as the parties shall reasonably agree.

          (c) Employee shall devote Employee's best efforts to the affairs of
Employer, serve faithfully and to the best of Employee's ability and devote all
agreed-upon working time and attention, knowledge, experience, energy and skill
to the business of Employer.

     3. Termination. Employee's employment by Employer shall be subject to
termination as follows:

                                       2

<PAGE>

          (a) Expiration of the Term. This Agreement shall terminate
automatically at the expiration of the Period of Employment unless the parties
enter into a written agreement extending Employee's employment, except for the
continuing obligations of the parties as specified hereunder.

          (b) Termination Upon Death. This Agreement shall terminate upon
Employee's death.

          (c) Termination for Cause. Employer may terminate Employee's
employment immediately for "cause" by written notice to Employee. For purposes
of this Agreement, a termination shall be for "cause" if the termination results
from any of the following events:

               (i) Material breach of this Agreement;

               (ii) Documented misconduct as a consultant of Employer, or any
subsidiary or affiliate of Employer for which Employee is performing services
hereunder including, but not limited to, misappropriating any funds or property
of any such company, or attempting to obtain any personal profit (x) from any
transaction to which such company is a party or (y) from any transaction with
any third party in which Employee has an interest which is adverse to the
interest of any such company, unless, in either case, Employee shall have first
obtained the written consent of the Board of Directors of Employer or Employee
should not reasonably have known of Employer's interest;

               (iii) Unreasonable neglect or refusal to perform the duties
assigned to Employee under or pursuant to this Agreement, unless cured within 60
days;

               (iv) Conviction of a crime involving moral turpitude;

                                       3

<PAGE>

               (v) Adjudication as a bankrupt, which adjudication has not been
contested in good faith, unless bankruptcy is caused directly by Employer's
unexcused failure to perform its obligations under this Agreement;

               (vi) Documented failure to follow the reasonable, written
instructions of the Board of Directors of Employer, provided that the
instructions are consistent with this Agreement and do not require Employee to
engage in unlawful conduct; or

               (vii) Any documented intentional violation by Employee of the
rules or regulations of the Office of the Comptroller of the Currency or of any
other regulatory agency.

     Notwithstanding any other term or provision of this Agreement to the
contrary, if Employee's employment is terminated for cause, Employee shall
forfeit all rights to payments and benefits otherwise provided pursuant to this
Agreement; provided, however, that Base Salary shall be paid through the date of
termination.

          (d) Termination For Reasons Other Than Cause. If Employer terminates
Employee prior to the expiration of this Agreement for reasons other than cause,
then Employee shall be entitled to a severance benefit equal to the greater of
(i) the annual Base Salary in effect at the time of termination, payable in
equal biweekly installments over the 12-month period following Employee's
termination, or (ii) amounts of Base Salary that otherwise would have been
payable through the balance of the unexpired term of this Agreement, payable in
biweekly installments through the balance of the unexpired term of this
Agreement.

     4. Fringe Benefits.

          (a) Benefit Plans. Because of the limited number of hours Employee
will be required to provide services to Employer during the Period of
Employment, Employee

                                       4

<PAGE>

shall not be eligible to participate as an active employee in any employee
pension benefit plans (as that term is defined under Section 3(2) of the
Employee Retirement Income Security Act of 1974, as amended), Employer-paid
group life insurance plans, medical plans, dental plans, long-term disability
plans, business travel insurance programs or other fringe benefit programs
maintained by Employer for the benefit of its employees. However, Employee will
be considered an eligible retiree under Employer's group health plan that covers
eligible retirees of Employer and will be covered under that plan as a retiree,
beginning on the first day of the Period of Employment. Participation in
Employer's group health plan for eligible retirees shall be based on, and
subject to satisfaction of, the requirements and conditions of such plan;
provided that Employee's prior service with First Heritage Bank shall be
considered service with Employer for purposes of determining Employee's
eligibility for coverage under Employer's group health plan for retirees. Except
as provided in paragraph 3(c), Employee's participation in Employer's group
health plan for eligible retirees shall not be terminated solely due to the
termination or expiration of this Agreement or the termination of Employee's
employment. Employer may require Employee to submit to an annual physical, to be
performed by a physician of his own choosing. Employee shall be reimbursed for
related expenses not covered by Employer's health insurance plan, or any other
plan in which Employee is enrolled. Employee shall not be eligible to
participate in Employer's Severance Pay Plan maintained for other employees not
covered by employment agreements.

          (b) Expenses. Upon submission to Employer of vouchers or other
required documentation, Employee shall be reimbursed for Employee's use of his
personal automobile, and for actual out-of-pocket travel and other expenses,
reasonably incurred and/or paid by Employee in connection with Employee's duties
hereunder. Reimbursable expenses

                                       5

<PAGE>

must be submitted to the President and Chief Executive Officer of Employer, or
the President and Chief Executive Officer's designee, for review on a quarterly
basis.

          (c) Other Benefits. During the Period of Employment, Employee also
shall be entitled to Employer-paid social memberships for Employee at two
country clubs and one social club in the Dallas or Scranton/Wilkes Barre,
Pennsylvania area, subject to the approval of the President and Chief Executive
Officer of Employer. Although it is contemplated that the memberships shall be
utilized for marketing and promotion of Employer's business interests, in the
event that any part of any membership shall be treated as taxable compensation
to Employee, Employer shall reimburse Employee for any federal, state or local
income tax owed by Employee, including any such taxes owed as a result of any
reimbursement under this subparagraph, in connection with such membership.

     5. First Heritage Employment Agreement.

          (a) Employer acknowledges that Employee could have become entitled to
certain payments pursuant to the July 1, 1999 Employment Agreement between
Employee and First Heritage Bank ("First Heritage Employment Agreement") as a
result of the Merger and/or upon the occurrence of certain other events, which
payments Employee has agreed to waive in connection with the Merger and the
execution of this Agreement. In consideration of such waiver, Employer shall pay
to Employee $300,000 on the closing date of the Merger.

          (b) Employer acknowledges that Employee previously earned a right to
receive certain bonuses that would have been paid to Employee by First Heritage
Bank upon the exercise of certain stock options previously granted to Employee
by First Heritage Bank, which option bonuses Employee has agreed to waive in
connection with the Merger and the

                                       6

<PAGE>

execution of this Agreement. In consideration of such waiver, Employer shall pay
to Employee $250,000 on the closing date of the Merger.

     6. Stock Options. Employer shall cause the Compensation Committee of the
Board of Directors of Employer to review whether Employee should be granted
shares of restricted stock and/or options to purchase shares of common stock of
Employer. Such review may be conducted pursuant to the terms of the Community
Bank System, Inc. 1994 Long-Term Incentive Compensation Program, a successor
plan, or independently, as the Compensation Committee shall determine. Reviews
shall be conducted no less frequently than annually.

     7. Withholding. Employer shall deduct and withhold from compensation and
benefits provided under this Agreement all necessary income and employment taxes
and any other similar sums required by law to be withheld.

     8. Covenants.

          (a) Confidentiality. Employee shall not, without the prior written
consent of Employer, disclose or use in any way, either during his employment by
Employer or thereafter, except to perform his services as an employee of
Employer, any confidential business or technical information or trade secret
that is not in the public domain acquired in the course of Employee's employment
by Employer. Employee acknowledges and agrees that it would be difficult to
fully compensate Employer for damages resulting from the breach or threatened
breach of the foregoing provision and, accordingly, that Employer shall be
entitled to temporary preliminary injunctions and permanent injunctions to
enforce such provision. This provision with respect to injunctive relief shall
not, however, diminish Employer's right to claim and recover damages. Employee
covenants to use his best efforts to prevent the publication or

                                       7

<PAGE>

disclosure of any trade secret or any confidential information that is not in
the public domain concerning the business or finances of Employer or Employer's
affiliates, or any of its or their dealings, transactions or affairs which may
come to Employee's knowledge in the pursuance of his duties or employment.

          (b) No Competition. Employee's employment is subject to the condition
that during the term of his employment hereunder and for the period specified in
paragraph 8(c) below, Employee shall not, directly or indirectly, own, manage,
operate, control or participate in the ownership, management, operation or
control of, or be connected as an officer, employee, partner, director,
individual proprietor, lender, consultant or otherwise with, or have any
financial interest in, or aid or assist anyone else in the conduct of, any
entity or business (a "Competitive Operation") which competes within a 50 mile
radius of Wilkes-Barre, Pennsylvania, in the banking industry or with any other
banking or financial services business conducted by Employer or by any group,
affiliate, division or subsidiary of Employer. Employee shall keep Employer
fully advised as to any activity, interest, or investment Employee may have in
any way related to the banking industry. It is understood and agreed that, for
the purposes of the foregoing provisions of this paragraph, (i) no business
shall be deemed to be a business conducted by Employer or any group, division,
affiliate or subsidiary of Employer unless 5% or more of Employer's consolidated
gross sales or operating revenues is derived from, or 5% or more of Employer's
consolidated assets are devoted to, such business; (ii) no business conducted by
any entity by which Employee is employed or in which he is interested or with
which he is connected or associated shall be deemed competitive with any
business conducted by Employer or any group, division, affiliate or subsidiary
of Employer unless it is one from which 2% or more of its consolidated gross
sales or operating revenues is derived, or to which 2% or

                                       8

<PAGE>

more of its consolidated assets are devoted; and (iii) no business which is
conducted by Employer at the Date of Termination and which subsequently is sold
by Employer shall, after such sale, be deemed to be a Competitive Operation
within the meaning of this paragraph. Ownership of not more than 5% of the
voting stock of any publicly held corporation shall not constitute a violation
of this paragraph.

          (c) Non-Competition Period. The "non-competition period" shall begin
on the date the first payment is made pursuant to the terms of this Agreement
and shall end on the later of (i) the date the final payment is made pursuant to
the terms of this Agreement, or (ii) the third anniversary of the closing date
of the Merger.

          (d) Termination of Payments. Upon the breach by Employee of any
covenant under this paragraph 8, Employer shall withhold all payments to
Employee and may offset immediately any and all amounts payable to Employee
under this Agreement against any damages to which Employer is legally entitled
in addition to any and all other remedies available to Employer under the law or
in equity.

     9. Notices. Any notice which may be given hereunder shall be sufficient if
in writing and mailed by overnight mail, or by certified mail, return receipt
requested, to Employee at his residence and to Employer at 5790 Widewaters
Parkway, Dewitt, New York 13214, or at such other addresses as either Employee
or Employer may, by similar notice, designate.

     10. Rules, Regulations and Policies. Employee shall abide by and comply
with all of the rules, regulations, and policies of Employer, including without
limitation Employer's policy of strict adherence to, and compliance with, any
and all requirements of the banking, securities, and antitrust laws and
regulations.

                                       9

<PAGE>

     11. No Prior Restrictions. Employee affirms and represents that Employee is
under no obligations to any former employer or other third party which is in any
way inconsistent with, or which imposes any restriction upon, the employment of
Employee by Employer, or Employee's undertakings under this Agreement.

     12. Return of Employer's Property. After Employee has received notice of
termination or at the end of the term hereof, whichever first occurs, Employee
shall promptly return to Employer all documents and other property in his
possession belonging to Employer.

     13. Construction and Severability. The invalidity of any one or more
provisions of this Agreement or any part thereof, all of which are inserted
conditionally upon their being valid in law, shall not affect the validity of
any other provisions to this Agreement; and in the event that one or more
provisions contained herein shall be invalid, as determined by a court of
competent jurisdiction, the court shall have authority to modify such provision
in a manner that most closely reflects the intent of the parties and is valid.

     14. Governing Law. This Agreement was executed and delivered in New York
and shall be construed and governed in accordance with the laws of the State of
New York.

     15. Assignability and Successors. This Agreement may not be assigned by
Employee or Employer, except that this Agreement shall be binding upon and shall
inure to the benefit of the successor of Employer through merger or corporate
reorganization.

     16. Miscellaneous. This Agreement constitutes the entire understanding and
agreement between the parties with respect to the subject matter hereof and
shall supersede all prior understandings and agreements, including the First
Heritage Employment Agreement. Employee hereby waives all claims Employee may
have under the First Heritage Employment Agreement, including, without
limitation, claims to any payment of deferred compensation

                                       10

<PAGE>

benefits, change of control benefits and bonuses related to the exercise of
stock options. The foregoing waiver shall not apply to the payment described in
paragraph 5 or to stock options assumed by Employer pursuant to the Agreement
and Plan of Merger between Employer and First Heritage Bank, except that the
waiver shall apply to the extent that any such option includes the right to a
bonus payment upon Employee's exercise of the option. This Agreement cannot be
amended, modified, or supplemented in any respect, except by a subsequent
written agreement entered into by the parties hereto. The services to be
performed by Employee are special and unique; it is agreed that any breach of
this Agreement by Employee shall entitle Employer (or any successor or assigns
of Employer), in addition to any other legal remedies available to it, to apply
to any court of competent jurisdiction to enjoin such breach. The provisions of
paragraph 8 hereof shall survive the termination of this Agreement.

     17. Counterparts. This Agreement may be executed in counterparts (each of
which need not be executed by each of the parties), which together shall
constitute one and the same instrument.

     18. Jurisdiction, Venue and Fees. The jurisdiction of any proceeding
between the parties arising out of, or with respect to, this Agreement shall be
in a court of competent jurisdiction in New York State, and venue shall be in
Onondaga County. Each party shall be subject to the personal jurisdiction of the
courts of New York State. If Employee is the prevailing party in a proceeding to
collect payments due pursuant to this Agreement, Employer shall reimburse
Employee for reasonable attorneys' fees incurred by Employee in connection with
such proceeding.

                                       11

<PAGE>

     The foregoing is established by the following signatures of the parties.

                                COMMUNITY BANK SYSTEM, INC.

                                By:_____________________________________________

                                Its:____________________________________________

                                COMMUNITY BANK, N.A.


                                By:_____________________________________________

                                Its:____________________________________________

                                ________________________________________________
                                         JAMES M. O'BRIEN

                                       12